Add linter and bashate tox checks

For correct job succeed need to add tox
checkers.

Change-Id: I725079819fc00c12da62389142a2b627e8352761
This commit is contained in:
Peter Razumovsky 2016-12-09 15:00:46 +04:00
parent 64127fe907
commit 3dd3071107
3 changed files with 43 additions and 0 deletions

5
tools/yamllint.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
workdir=$(dirname $0)
yamllint -c $workdir/yamllint.yaml $(find . -not -path '*/\.*' -type f -name '*.yaml')

21
tools/yamllint.yaml Normal file
View File

@ -0,0 +1,21 @@
extends: default
rules:
braces:
max-spaces-inside: 1
comments:
level: error
comments-indentation:
level: warning
document-end:
present: no
document-start:
level: error
present: no
empty-lines:
max: 1
max-start: 0
max-end: 0
line-length:
level: warning
max: 120

17
tox.ini Normal file
View File

@ -0,0 +1,17 @@
[tox]
minversion = 1.6
envlist = linters,bashate
skipsdist = True
[testenv:venv]
commands = {posargs}
[testenv:linters]
deps = yamllint
commands =
{toxinidir}/tools/yamllint.sh
[testenv:bashate]
deps = bashate>=0.2
whitelist_externals = bash
commands = bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v"