Yaml linter execution and config improved

Change-Id: Ie4aedfb4f4a76d20f0d0432fe6c3a4665501e167
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:43:50 -07:00
parent 0a998b1dd4
commit 1abcb7293d
7 changed files with 48 additions and 16 deletions

View File

@ -1,3 +1,4 @@
# yamllint disable
service:
name: {{ service_name }}
ports:
@ -66,3 +67,4 @@ files:
wsgi-{{ service_name }}-conf:
path: /etc/apache2/conf-enabled/wsgi-{{ service_name }}.conf
content: wsgi-{{ service_name }}.conf.j2
# yamllint enable

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

@ -19,6 +19,10 @@ commands =
bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -exec bashate -v \{\} \;"
flake8 {posargs}
[testenv:linters]
deps = yamllint
commands = {toxinidir}/tools/yamllint.sh
[testenv:venv]
commands = {posargs}