[flake8] Enable extra, optional hacking checks
Update test-requirements.txt to use latest version of: * hacking Enable the following off-by-default checks: * [H203] Use assertIs(Not)None to check for None. * [H204] Use assert(Not)Equal to check for equality. * [H205] Use assert(Greater|Less)(Equal) for comparison. * [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls * [H904] Delay string interpolations at logging calls. Made minimal code changes to comply with changes. Change-Id: I3559ead76b5476650d7193e7023d349175234922
This commit is contained in:
parent
279418673a
commit
8715fe3e02
@ -32,7 +32,7 @@ class TestApi(test_base.DeckhandTestCase):
|
||||
resource_name = resource.__name__.split('.')[-1]
|
||||
resource_obj = mock.patch.object(
|
||||
resource, '%sResource' % resource_name.title().replace(
|
||||
'_', '')).start()
|
||||
'_', ''), autospec=True).start()
|
||||
setattr(self, '%s_resource' % resource_name, resource_obj)
|
||||
|
||||
@mock.patch.object(api, 'db_api', autospec=True)
|
||||
|
@ -3,7 +3,7 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
# Hacking already pins down pep8, pyflakes and flake8
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
hacking>=1.0.0 # Apache-2.0
|
||||
|
||||
falcon>=1.0.0 # Apache-2.0
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
|
@ -3,7 +3,7 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
# Hacking already pins down pep8, pyflakes and flake8
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
hacking>=1.0.0 # Apache-2.0
|
||||
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
|
12
tox.ini
12
tox.ini
@ -59,8 +59,12 @@ commands = oslo-config-generator --config-file=etc/deckhand/config-generator.con
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[flake8]
|
||||
# D100-104 deal with docstrings in public functions
|
||||
# D205, D400, D401 deal with docstring formatting
|
||||
enable-extensions = H106,H203,H904
|
||||
# [H106] Don’t put vim configuration in source files.
|
||||
# [H203] Use assertIs(Not)None to check for None.
|
||||
# [H204] Use assert(Not)Equal to check for equality.
|
||||
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
||||
# [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
|
||||
# [H904] Delay string interpolations at logging calls.
|
||||
enable-extensions = H106,H203,H204,H205,H210,H904
|
||||
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
|
||||
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools/xenserver*,releasenotes
|
||||
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes
|
||||
|
Loading…
x
Reference in New Issue
Block a user