Merge "This commit adds a pep8 job to zuul"

This commit is contained in:
Zuul 2019-08-02 13:19:59 +00:00 committed by Gerrit Code Review
commit 0af6c274a8
3 changed files with 55 additions and 0 deletions

View File

@ -5,6 +5,8 @@
check:
jobs:
- build-openstack-releasenotes
- openstack-tox-pep8
gate:
jobs:
- build-openstack-releasenotes
- openstack-tox-pep8

View File

@ -1,3 +1,4 @@
hacking>=1.1.0,<1.2.0 # Apache-2.0
PyYAML>=3.1.0
yamllint>=0.5.2
doc8

52
tox.ini
View File

@ -30,6 +30,58 @@ commands =
-print0 | xargs -0 yamllint"
doc8 doc/source
[testenv:pep8]
basepython = python3
commands = flake8 {posargs}
[flake8]
# Following checks should be enabled in the future.
#
# H101 Use TODO(NAME)
# H104 File contains nothing but comments
# H201 no 'except:'
# H238 old style class declaration
# H301 one import per line
# H306 imports not in alphabetical order
# H401 docstring should not start with a space
# H403 multi line docstrings should end on a new line
# H404 multi line docstring should start without a leading new line
# H405 multi line docstring summary not separated with an empty line
# H903 Windows style line endings not allowed in code
#
# W291 trailing whitespace
# W292 no newline at end of file
# W391 blank line at end of file
# W503 line break before binary operator
#
# E121 continuation line under-indented for hanging indent
# E123 closing bracket does not match indentation of opening bracket's line
# E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E226 missing whitespace around arithmetic operator
# E241 multiple spaces after ','
# E261 at least two spaces before inline comment
# E302 expected 2 blank lines, found 1
# E303 too many blank lines
# E713 test for membership should be 'not in'
# E731 do not assign a lambda expression, use a def
#
# F401 'X' imported but unused
# F403 from module import * used; unable to detect undefined names
# F811 redefinition of unused 'X' from line 'Y'
# F841 local variable 'X' is assigned to but never used
#
ignore = H101,H104,H201,H238,H301,H306,H401,H403,H404,H405,H903,
W291,W292,W391,W503,
E121,E123,E126,E127,E128,E226,E261,E241,E302,E303,E713,E731,
F401,F403,F811,F841
show-source = True
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasenotes
# Default max-line-length is 80. This should be reduced as the files are cleaned up.
max-line-length = 109
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt