From 196ba01bac8a6a19b063618cd20d70eab2087f49 Mon Sep 17 00:00:00 2001 From: Martin Oemke Date: Fri, 18 Dec 2015 15:44:30 +0100 Subject: [PATCH] Fix E265, E129, E113 errors in tackerclient code This Patch fixes all E265, E129, E113 errors and enables this test for all new patches to tacker. [E265] block comment should start with '# ' [E129] visually indented line with same indent as next logical line [E113] unexpected indentation Change-Id: I708dd9e0c4f3edb0b52a865578aceace726d1c2e Related-Bug: 1516045 --- tackerclient/tacker/v1_0/__init__.py | 8 ++++---- tackerclient/tests/unit/test_shell.py | 2 +- tox.ini | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tackerclient/tacker/v1_0/__init__.py b/tackerclient/tacker/v1_0/__init__.py index 0edc94f5..70886411 100644 --- a/tackerclient/tacker/v1_0/__init__.py +++ b/tackerclient/tacker/v1_0/__init__.py @@ -263,7 +263,7 @@ def parse_args_to_dict(values_specs): # All others are value items # Make sure '--' occurs first and allow minus value if (not current_item or '=' in current_item or - _item.startswith('-') and not is_number(_item)): + _item.startswith('-') and not is_number(_item)): raise exceptions.CommandError( _("Invalid values_specs %s") % ' '.join(values_specs)) _value_number += 1 @@ -308,7 +308,7 @@ def _merge_args(qCmd, parsed_args, _extra_values, value_specs): if isinstance(arg_value, list): if value and isinstance(value, list): if (not arg_value or - type(arg_value[0]) == type(value[0])): + type(arg_value[0]) == type(value[0])): arg_value.extend(value) _extra_values.pop(key) @@ -362,8 +362,8 @@ class TackerCommand(command.OpenStackCommand): # NOTE(markmcclain): This is no longer supported in cliff version 1.5.2 # see https://bugs.launchpad.net/python-tackerclient/+bug/1265926 - #if hasattr(self, 'formatters'): - #self.formatters['table'] = TableFormater() + # if hasattr(self, 'formatters'): + # self.formatters['table'] = TableFormater() def get_client(self): return self.app.client_manager.tacker diff --git a/tackerclient/tests/unit/test_shell.py b/tackerclient/tests/unit/test_shell.py index 87b6970d..5c22f1bf 100644 --- a/tackerclient/tests/unit/test_shell.py +++ b/tackerclient/tests/unit/test_shell.py @@ -118,7 +118,7 @@ class ShellTest(testtools.TestCase): 'either --os-url or env[OS_URL]', stderr.strip()) def test_auth(self): - #import pdb; pdb.set_trace() + # import pdb; pdb.set_trace() tacker_shell = openstack_shell.TackerShell('1.0') self.addCleanup(self.mox.UnsetStubs) self.mox.StubOutWithMock(clientmanager.ClientManager, '__init__') diff --git a/tox.ini b/tox.ini index 3465d9bd..daf9717a 100644 --- a/tox.ini +++ b/tox.ini @@ -29,10 +29,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' # H302 import only modules # H105 Don't use author tags # H405 multi line docstring summary not separated with an empty line -# E265 block comment should start with '# ' # H238 old style class declaration, use new style (inherit from `object`) -# E129 visually indented line with same indent as next logical line -# E113 unexpected indentation -ignore = E125,H302,H105,H405,E265,H238,E129,E113 +ignore = E125,H302,H105,H405,H238 show-source = true exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools