diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..9c935eb --- /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 c3006f2..c75baaa 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,4 @@ +--- - project: templates: - check-requirements @@ -6,3 +7,9 @@ - release-notes-jobs-python3 - periodic-stable-jobs - periodic-jobs-with-oslo-master + check: + jobs: + - openstack-tox-linters + gate: + jobs: + - openstack-tox-linters diff --git a/HACKING.rst b/HACKING.rst index 109f348..a2754da 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -4,7 +4,7 @@ masakari-monitors Style Commandments Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ masakari-monitors Specific Commandments ------------------------------- +--------------------------------------- - [M301] Ensure that the _() function is explicitly imported to ensure proper translations. - [M302] Validate that log messages are not translated. diff --git a/tox.ini b/tox.ini index e38c613..d045e6f 100644 --- a/tox.ini +++ b/tox.ini @@ -21,9 +21,42 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEB [testenv:genconfig] commands = oslo-config-generator --config-file=etc/masakarimonitors/masakarimonitors-config-generator.conf +[testenv:linters] +skip_install = True +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + {[testenv:pep8]deps} + {[testenv:doc8]deps} + {[testenv:yamllint]deps} +commands = + {[testenv:pep8]commands} + {[testenv:doc8]commands} + {[testenv:yamllint]commands} + [testenv:pep8] +skip_install = True +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + hacking commands = flake8 {posargs} +[testenv:doc8] +skip_install = True +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + doc8 +commands = + doc8 README.rst CONTRIBUTING.rst HACKING.rst doc/source + doc8 releasenotes/source + doc8 -e '.yaml' releasenotes/notes + +[testenv:yamllint] +skip_install = True +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + yamllint +commands = yamllint -s . + [testenv:venv] commands = {posargs} @@ -94,3 +127,8 @@ paths = ./masakarimonitors/hacking 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