Yaml linter execution and config improved

Change-Id: I29c124f9c84f6d5c7efc77edc7c7a85e75392b15
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:45:55 -07:00
parent 15bcb96925
commit 548ad8ff87
11 changed files with 61 additions and 45 deletions

View File

@ -40,7 +40,6 @@
triggers:
- zuul
- project:
name: fuel-ccp-docs-build-jobs
jobs:

View File

@ -12,4 +12,3 @@
global: true
triggers:
- zuul

View File

@ -29,7 +29,6 @@
branches:
- '{scm-branch}'
- scm:
name: zuul_repo
scm:
@ -56,7 +55,6 @@
# Static repositories
#
#
# SSH credentials
#
@ -82,7 +80,7 @@
#
# Publishers
#
#TODO: check target fuel-ccp-ci
# TODO: check target fuel-ccp-ci
- publisher:
name: logs-public
publishers:

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

@ -10,8 +10,10 @@ deps =
usedevelop = False
[testenv:linters]
whitelist_externals =
bash
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
{toxinidir}/tools/yamllint.sh
# bashate check
bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v -iE006"

View File

@ -161,4 +161,3 @@ projects:
periodic:
- 'mcp-build-images-build-number'
- 'mcp-clean-docker-registry'