Use some better linting

Lints docs and yaml files in addition to Python.

Change-Id: I5255362cd6d2194600e149b118da4fbe102ffdb1
This commit is contained in:
Radosław Piliszek 2020-09-01 19:25:38 +02:00
parent f12052a9a4
commit 9e7d35b889
5 changed files with 42 additions and 0 deletions

8
.yamllint Normal file
View File

@ -0,0 +1,8 @@
---
extends: default
ignore: |
.tox/
rules:
line-length: disable

View File

@ -130,8 +130,12 @@
- release-notes-jobs-python3
check:
jobs:
- openstack-tox-linters
- masakari-functional-devstack-multinode:
voting: true
gate:
jobs:
- openstack-tox-linters
- project:
masakari-systemfault-integration-ci:

View File

@ -14,6 +14,7 @@ coverage==4.0
ddt==1.0.1
debtcollector==1.19.0
decorator==4.2.1
doc8==0.6.0
docutils==0.14
dogpile.cache==0.6.5
dulwich==0.19.0

View File

@ -6,6 +6,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
doc8>=0.6.0 # Apache-2.0
pep8>=1.5.7
psycopg2>=2.8 # LGPL/ZPL
PyMySQL>=0.7.6 # MIT License
@ -18,3 +19,4 @@ requests-mock>=1.2.0 # Apache-2.0
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
yamllint>=1.22.0 # GPLv3

27
tox.ini
View File

@ -29,9 +29,31 @@ commands = oslo-config-generator --config-file=etc/masakari/masakari-config-gene
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/masakari/masakari-policy-generator.conf
[testenv:linters]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
commands =
{[testenv:pep8]commands}
{[testenv:doc8]commands}
{[testenv:yamllint]commands}
[testenv:pep8]
deps = {[testenv:linters]deps}
commands = flake8 {posargs}
[testenv:doc8]
deps = {[testenv:linters]deps}
commands =
doc8 README.rst CONTRIBUTING.rst HACKING.rst doc/source
doc8 releasenotes/source
doc8 -e '.yaml' releasenotes/notes
doc8 -e '.rst' -e '.inc' api-ref/source
[testenv:yamllint]
deps = {[testenv:linters]deps}
commands = yamllint -s .
[testenv:venv]
commands = {posargs}
@ -133,3 +155,8 @@ deps =
deps = bindep
commands = bindep test
usedevelop = False
[doc8]
# NOTE(yoctozepto): this is due to multiple violations - it is better to keep
# it limited sanely rather than disable the D001 "Line too long" rule altogether
max-line-length = 105