diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..9c935eb1 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +ignore: | + .tox/ + +rules: + line-length: disable diff --git a/.zuul.yaml b/.zuul.yaml index 8156b17b..acc0116a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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: diff --git a/lower-constraints.txt b/lower-constraints.txt index 38cfa849..cef1f1fb 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 707e7700..86eb838d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index ce5b5b57..9ffe09d8 100644 --- a/tox.ini +++ b/tox.ini @@ -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