From a40bce19f9cf784bf29b4829e0b256aa941fc120 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Fri, 1 Feb 2019 17:06:12 -0600 Subject: [PATCH] Enable additional flake8 checks 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. H102 Apache 2.0 license header not found H104 File contains nothing but comments H105 Don't use author tags H233 Python 3.x incompatible use of print operator H236 Python 3.x incompatible __metaclass__ H238 old style class declaration, use new style 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 H702 Argument to ... must be a string H903 Windows style line endings not allowed in code At a later time, additional commits will fix and un-suppress them. Story: 2004515 Task: 29304 Change-Id: I7f9e36cb605e47338dc5d33c94d1c0b09943a38a Signed-off-by: Al Bailey --- test-requirements.txt | 2 +- tox.ini | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index d4986482..71c1c3c4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ +hacking!=0.13.0,<0.14,>=0.12.0 bashate >= 0.2 PyYAML >= 3.1.0 yamllint >= 0.5.2 -flake8 < 3.6.0 diff --git a/tox.ini b/tox.ini index bb0bba19..08b17a61 100644 --- a/tox.ini +++ b/tox.ini @@ -41,12 +41,30 @@ commands = flake8 [flake8] +# H102 Apache 2.0 license header not found +# H104 File contains nothing but comments +# H105 Don't use author tags +# H233 Python 3.x incompatible use of print operator +# H236 Python 3.x incompatible __metaclass__ +# H238 old style class declaration, use new style +# 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 +# H702 Argument to ... must be a string +# H903 Windows style line endings not allowed in code # E123, E125 skipped as they are invalid PEP-8. # E501 skipped because some of the code files include templates # that end up quite wide show-source = True -ignore = E123,E125,E501,H405 +ignore = H102,H104,H105,H233,H236,H238,H301,H306,H401,H403,H404,H405,H702,H903,E123,E125,E501 exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-* +# TODO: H106 Don’t put vim configuration in source files (off by default). +# H203 Use assertIs(Not)None to check for None (off by default). +# TODO: H904 Delay string interpolations at logging calls (off by default). +enable-extensions = H203 [testenv:venv] basepython = python3