Merge "Add yamllint tox environment"

This commit is contained in:
Zuul 2020-05-20 16:46:12 +00:00 committed by Gerrit Code Review
commit 25475c90e9
2 changed files with 60 additions and 0 deletions

11
tox.ini
View File

@ -20,3 +20,14 @@ commands =
docstheme-build-translated.sh
whitelist_externals =
rm
[testenv:lint]
deps = yamllint
commands =
bash -c "rm -rf {toxinidir}/.yamllint"
bash -c "mkdir -p {toxinidir}/.yamllint"
bash -c "cp -r $(ls {toxinidir}) {toxinidir}/.yamllint/"
bash -c "find {toxinidir}/.yamllint -type f -exec sed -i 's/%%%.*/XXX/g' \{\} +"
bash -c "yamllint -c {toxinidir}/yamllint.conf {toxinidir}/.yamllint/*/values*"
whitelist_externals =
bash

49
yamllint.conf Normal file
View File

@ -0,0 +1,49 @@
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces:
level: warning
brackets:
level: warning
colons:
level: warning
commas:
level: warning
comments:
level: warning
comments-indentation:
level: warning
document-end:
level: warning
document-start:
level: warning
empty-lines:
level: warning
empty-values:
level: warning
hyphens:
level: warning
indentation:
spaces: 2
indent-sequences: whatever
level: warning
key-duplicates:
level: warning
key-ordering: disable
line-length: disable
new-line-at-end-of-file:
level: warning
new-lines:
level: warning
octal-values:
level: warning
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
...