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:
Sushil Kumar
2015-05-20 20:13:02 +00:00
parent 82e05cb13a
commit 025191af50
7 changed files with 9 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order # 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 # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking>=0.8.0,<0.9 hacking>=0.10.0,<0.11
coverage>=3.6 coverage>=3.6
discover discover
oslosphinx>=2.5.0 # Apache-2.0 oslosphinx>=2.5.0 # Apache-2.0

View File

@@ -37,6 +37,6 @@ commands =
python setup.py build_sphinx python setup.py build_sphinx
[flake8] [flake8]
ignore = H202 ignore = H202,H405,H501
show-source = True show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build, exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,

View File

@@ -40,7 +40,7 @@ class CommonTest(testtools.TestCase):
sys.exit = self.orig_sys_exit sys.exit = self.orig_sys_exit
def test_methods_of(self): def test_methods_of(self):
class DummyClass: class DummyClass(object):
def dummyMethod(self): def dummyMethod(self):
print("just for test") print("just for test")

View File

@@ -79,7 +79,7 @@ class FakeHTTPClient(client.HTTPClient):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.callstack = [] self.callstack = []
self.fixtures = kwargs.pop("fixtures", None) or {} 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, ) args = (None, )
super(FakeHTTPClient, self).__init__(*args, **kwargs) super(FakeHTTPClient, self).__init__(*args, **kwargs)