Fixes new hacking rules
Updated the hacking version as per global-requirements. Fixed some of new appearing hacking rules, as listed follows: - E128 continuation line under-indented for visual indent - E265 block comment should start with '# ' - E713 test for membership should be 'not in' - H238 old style class declaration, use new style (inherit from `object`) Rules which are not yet fixed have been incorporated to ignorelist - H405 Multi line docstrings should start with a one line summary followed by an empty line - H501 Do not use locals() or self.__dict__ for formatting strings Change-Id: I885c6fa8ad0e6a98f7a8479f3441ed08ed2cbaa6
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
hacking>=0.8.0,<0.9
|
||||
hacking>=0.10.0,<0.11
|
||||
coverage>=3.6
|
||||
discover
|
||||
oslosphinx>=2.5.0 # Apache-2.0
|
||||
|
2
tox.ini
2
tox.ini
@@ -37,6 +37,6 @@ commands =
|
||||
python setup.py build_sphinx
|
||||
|
||||
[flake8]
|
||||
ignore = H202
|
||||
ignore = H202,H405,H501
|
||||
show-source = True
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,
|
||||
|
@@ -40,7 +40,7 @@ class CommonTest(testtools.TestCase):
|
||||
sys.exit = self.orig_sys_exit
|
||||
|
||||
def test_methods_of(self):
|
||||
class DummyClass:
|
||||
class DummyClass(object):
|
||||
def dummyMethod(self):
|
||||
print("just for test")
|
||||
|
||||
|
@@ -456,7 +456,7 @@ class Resource(object):
|
||||
|
||||
def __getattr__(self, k):
|
||||
if k not in self.__dict__:
|
||||
#NOTE(bcwaldon): disallow lazy-loading if already loaded once
|
||||
# NOTE(bcwaldon): disallow lazy-loading if already loaded once
|
||||
if not self.is_loaded:
|
||||
self._get()
|
||||
return self.__getattr__(k)
|
||||
|
@@ -79,7 +79,7 @@ class FakeHTTPClient(client.HTTPClient):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.callstack = []
|
||||
self.fixtures = kwargs.pop("fixtures", None) or {}
|
||||
if not args and not "auth_plugin" in kwargs:
|
||||
if not args and "auth_plugin" not in kwargs:
|
||||
args = (None, )
|
||||
super(FakeHTTPClient, self).__init__(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user