Yaml linter execution and config improved

Change-Id: Id0298e58d7b3ba1ff4c2b143de7f1915da9f6408
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:46:23 -07:00
parent 9061f35611
commit 6b7555c4d2
4 changed files with 27 additions and 8 deletions

View File

@ -1,7 +0,0 @@
#!/bin/bash
### Temp yaml syntax checker script.
set -e
for file in $(find . -name '*.yaml'); do
yamllint -d relaxed $file
done

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

View File

@ -8,7 +8,7 @@ deps = -r{toxinidir}/test-requirements.txt
[testenv:linters]
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
{toxinidir}/tools/yamllint.sh
[testenv:bashate]
whitelist_externals = bash