Enable: E122 continuation line missing indentation or outdented

Change-Id: I90897f0c027a5b7ed43f42030bf7c5425be66b84
Closes-Bug: #1398558
This commit is contained in:
Samta Rangare 2014-12-06 22:33:00 +05:30
parent 1bd869c3df
commit ee647bfe63
3 changed files with 78 additions and 78 deletions

View File

@ -313,10 +313,10 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': self.val_trans})} 'translator': self.val_trans})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
self.assertEqual(1, len(rows)) self.assertEqual(1, len(rows))
@ -330,10 +330,10 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': self.val_trans})} 'translator': self.val_trans})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
self.assertEqual(1, len(rows)) self.assertEqual(1, len(rows))
@ -347,7 +347,8 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'translator': self.val_trans},)} {'fieldname': 'testfield1',
'translator': self.val_trans},)}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
self.assertEqual(1, len(rows)) self.assertEqual(1, len(rows))
@ -364,14 +365,14 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'id-col': 'id_col', 'selector-type': 'DOT_SELECTOR', 'id-col': 'id_col', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': {'translation-type': 'VALUE', 'translator': {'translation-type': 'VALUE',
'extract-fn': lambda x: x['a']}}, 'extract-fn': lambda x: x['a']}},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': {'translation-type': 'VALUE', 'translator': {'translation-type': 'VALUE',
'extract-fn': lambda x: x.b}}, 'extract-fn': lambda x: x.b}},
{'fieldname': 'testfield3', 'col': 'col3', {'fieldname': 'testfield3', 'col': 'col3',
'translator': {'translation-type': 'VALUE'}})} 'translator': {'translation-type': 'VALUE'}})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
self.assertEqual(1, len(rows)) self.assertEqual(1, len(rows))
@ -385,16 +386,16 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': {'translation-type': 'LIST', 'translator': {'translation-type': 'LIST',
'table-name': 'subtable1', 'table-name': 'subtable1',
'id-col': 'id', 'val-col': 'value', 'id-col': 'id', 'val-col': 'value',
'translator': self.val_trans}}, 'translator': self.val_trans}},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': {'translation-type': 'LIST', 'translator': {'translation-type': 'LIST',
'table-name': 'subtable2', 'table-name': 'subtable2',
'id-col': 'id', 'val-col': 'value', 'id-col': 'id', 'val-col': 'value',
'translator': self.val_trans}})} 'translator': self.val_trans}})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
k1 = self.compute_hash(('FOO', 'BAR')) k1 = self.compute_hash(('FOO', 'BAR'))
@ -416,18 +417,18 @@ class TestDatasourceDriver(base.TestCase):
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': {'translation-type': 'VDICT', 'translator': {'translation-type': 'VDICT',
'table-name': 'subtable1', 'table-name': 'subtable1',
'id-col': 'id', 'key-col': 'key', 'id-col': 'id', 'key-col': 'key',
'val-col': 'value', 'val-col': 'value',
'translator': self.val_trans}}, 'translator': self.val_trans}},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': {'translation-type': 'VDICT', 'translator': {'translation-type': 'VDICT',
'table-name': 'subtable2', 'table-name': 'subtable2',
'id-col': 'id', 'key-col': 'key', 'id-col': 'id', 'key-col': 'key',
'val-col': 'value', 'val-col': 'value',
'translator': self.val_trans}})} 'translator': self.val_trans}})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
k1 = self.compute_hash((('a', 123), ('b', 456))) k1 = self.compute_hash((('a', 123), ('b', 456)))
@ -451,32 +452,32 @@ class TestDatasourceDriver(base.TestCase):
'selector-type': 'DICT_SELECTOR', 'selector-type': 'DICT_SELECTOR',
'id-col': 'id', 'id-col': 'id',
'field-translators': ( 'field-translators': (
{'fieldname': 'a', {'fieldname': 'a',
'col': 'a1', 'col': 'a1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'b', {'fieldname': 'b',
'col': 'b1', 'col': 'b1',
'translator': self.val_trans})} 'translator': self.val_trans})}
subtranslator_2 = {'translation-type': 'HDICT', subtranslator_2 = {'translation-type': 'HDICT',
'table-name': 'subtable2', 'table-name': 'subtable2',
'selector-type': 'DICT_SELECTOR', 'selector-type': 'DICT_SELECTOR',
'id-col': 'id', 'id-col': 'id',
'field-translators': ( 'field-translators': (
{'fieldname': 'c', {'fieldname': 'c',
'col': 'c1', 'col': 'c1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'd', {'fieldname': 'd',
'col': 'd1', 'col': 'd1',
'translator': self.val_trans})} 'translator': self.val_trans})}
translator = {'translation-type': 'HDICT', 'table-name': 'testtable', translator = {'translation-type': 'HDICT', 'table-name': 'testtable',
'selector-type': 'DOT_SELECTOR', 'selector-type': 'DOT_SELECTOR',
'field-translators': ( 'field-translators': (
{'fieldname': 'testfield1', 'col': 'col1', {'fieldname': 'testfield1', 'col': 'col1',
'translator': subtranslator_1}, 'translator': subtranslator_1},
{'fieldname': 'testfield2', 'col': 'col2', {'fieldname': 'testfield2', 'col': 'col2',
'translator': subtranslator_2})} 'translator': subtranslator_2})}
rows, k = DataSourceDriver.convert_obj(resp, translator) rows, k = DataSourceDriver.convert_obj(resp, translator)
@ -786,23 +787,23 @@ class TestDatasourceDriver(base.TestCase):
'table-name': 'subtable1', 'table-name': 'subtable1',
'id-col': 'id1', 'id-col': 'id1',
'field-translators': ( 'field-translators': (
{'fieldname': 'a', {'fieldname': 'a',
'col': 'a1', 'col': 'a1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'b', {'fieldname': 'b',
'col': 'b1', 'col': 'b1',
'translator': self.val_trans})}}, 'translator': self.val_trans})}},
{'fieldname': 'testfield2', {'fieldname': 'testfield2',
'translator': {'translation-type': 'HDICT', 'translator': {'translation-type': 'HDICT',
'table-name': 'subtable2', 'table-name': 'subtable2',
'id-col': 'id2', 'id-col': 'id2',
'field-translators': ( 'field-translators': (
{'fieldname': 'c', {'fieldname': 'c',
'col': 'c1', 'col': 'c1',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'd', {'fieldname': 'd',
'col': 'd1', 'col': 'd1',
'translator': self.val_trans})}}, 'translator': self.val_trans})}},
{'fieldname': 'ztestfield3', 'col': 'zparent_col3', {'fieldname': 'ztestfield3', 'col': 'zparent_col3',
'translator': self.val_trans}, 'translator': self.val_trans},
{'fieldname': 'testfield4', 'col': 'parent_col4', {'fieldname': 'testfield4', 'col': 'parent_col4',

View File

@ -515,10 +515,10 @@ def create_network_group(tablename, full_neutron_tablename=None):
network_args = ['x' + str(i) for i in xrange(0, network_max_index + 1)] network_args = ['x' + str(i) for i in xrange(0, network_max_index + 1)]
formula = compile.parse1( formula = compile.parse1(
'{}({}) :- {}({})'.format( '{}({}) :- {}({})'.format(
tablename, tablename,
'x' + str(network_id_index), 'x' + str(network_id_index),
full_neutron_tablename, full_neutron_tablename,
",".join(network_args))) ",".join(network_args)))
return formula return formula
@ -535,11 +535,11 @@ def create_networkXnetwork_group(tablename):
net2_args = ['y' + str(i) for i in xrange(0, network_max_index + 1)] net2_args = ['y' + str(i) for i in xrange(0, network_max_index + 1)]
formula = compile.parse1( formula = compile.parse1(
'{}({},{}) :- neutron:networks({}), neutron2:networks({})'.format( '{}({},{}) :- neutron:networks({}), neutron2:networks({})'.format(
tablename, tablename,
'x' + str(network_id_index), 'x' + str(network_id_index),
'y' + str(network_id_index), 'y' + str(network_id_index),
",".join(net1_args), ",".join(net1_args),
",".join(net2_args))) ",".join(net2_args)))
return formula return formula

View File

@ -46,12 +46,11 @@ commands = python setup.py testr --no-parallel --testr-args='test_benchmark {pos
# H904 Wrap long lines in parentheses instead of a backslash # H904 Wrap long lines in parentheses instead of a backslash
# H404 multi line docstring should start with a summary # H404 multi line docstring should start with a summary
# H231 Python 3.x incompatible # H231 Python 3.x incompatible
# E122 continuation line missing indentation or outdented
# E113 unexpected indentation # E113 unexpected indentation
# H302 import only modules # H302 import only modules
show-source = True show-source = True
ignore = E128,E129,E251,F402,F811,F812,H237,H305,H401,H404,H405,H904,H231,E122,H302 ignore = E128,E129,E251,F402,F811,F812,H237,H305,H401,H404,H405,H904,H231,H302
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,*thirdparty/*,CongressLexer.py,CongressParser.py exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,*thirdparty/*,CongressLexer.py,CongressParser.py