Add additional checks to flake8 job

By setting 'hacking' as the dependency, flake8
will include hacking and other checks.
This is the same set used by other openstack
components.

This commit suppresses any of those new checks that
would fail.
 H101  Use TODO(NAME)
 H102  Apache 2.0 license header not found
 H105  Don't use author tags
 H237  module posixfile is removed in Python 3
 H238  old style class declaration
 H301  one import per line
 H306  imports not in alphabetical order
 H401  docstring should not start with a space
 H404  multi line docstring should start without a leading new line
 H405  multi line docstring summary not separated with an empty line

It also sets the max line length to be very large.

At a later time, additional commits will fix and un-suppress them.

Story: 2004515
Task: 29303
Change-Id: Id572d5c0ecab1854ca881e34b95459ef563be0f2
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey 2019-02-01 15:58:29 -06:00
parent b1b3093b95
commit bcc938ca12
2 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,7 @@
bashate >= 0.2
PyYAML >= 3.1.0
yamllint >= 0.5.2
hacking!=0.13.0,<0.14,>=0.12.0
# The following are for py27 and py35
#mock # BSD
#nose # LGPL

20
tox.ini
View File

@ -51,21 +51,35 @@ commands =
[flake8]
# ignore below errors , will fix flake8 errors in future
# H101 Use TODO(NAME)
# H102 Apache 2.0 license header not found
# H105 Don't use author tags
# H237 module posixfile is removed in Python 3
# H238 old style class declaration
# H301 one import per line
# H306 imports not in alphabetical order
# H401 docstring should not start with a space
# H404 multi line docstring should start without a leading new line
# H405 multi line docstring summary not separated with an empty line
# E501 skipped because some of the code files include templates
# that end up quite wide
# F401 'XXXXX' imported but unused
# F841 local variable 'XXXXXX' is assigned to but never used
show-source = True
ignore = E501,F401,F841
ignore = H101,H102,H105,H237,H238,H301,H306,H401,H404,H405,E501,F401,F841
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
# TODO: H106 Dont put vim configuration in source files (off by default).
# H203 Use assertIs(Not)None to check for None (off by default).
# TODO: enable: H904 Delay string interpolations at logging calls (off by default).
enable-extensions = H203
max-line-length = 120
# Use flake8 to replace pep8.
[testenv:pep8]
basepython = python3
usedevelop = False
skip_install = True
deps =
flake8<3.6.0
commands =
flake8