Add yamllint check to lint job

Initial commit with bootstrapping non-voting configuration
for yamllint. Yamllint checks will be switched from 'warning'
to 'enabled' in subsequent commits together with code adjustments.

Also quotes %%%.* fields in netpol.yaml to make them valid.

Change-Id: I24cb0b7680f1fb9c0dfd98527e85440a6635d1d7
This commit is contained in:
Andrii Ostapenko 2020-05-17 23:10:06 -05:00
parent 03621fef8e
commit 78635bd331
2 changed files with 70 additions and 0 deletions

21
tox.ini Normal file
View File

@ -0,0 +1,21 @@
[tox]
minversion = 3.1
envlist = docs
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
passenv = *_proxy *_PROXY
[testenv:venv]
commands = {posargs}
[testenv:lint]
deps = yamllint
commands =
bash -c "yamllint -c {toxinidir}/yamllint.conf */values* yamllint.conf"
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
...