Do not ignore E123, E125 per PEP 8-Style Guide for Python Code
Do not ignore E123, E125 per PEP 8-Style Guide for Python Code.[1] To ignore E123 and E125 is not recommended by PEP 8-Style Guide for Python Code Guildeline practice as it creates style/indentation mis-match. [1]http://pep8.readthedocs.io/en/latest/intro.html#id3 Change-Id: I6dc4358a4a3e9e9d854f2f76e3c8acc5cf58d434
This commit is contained in:
parent
76cbe003d0
commit
34879f8ea0
|
@ -44,7 +44,7 @@ class CapabilityTypeDef(StatefulEntityType):
|
|||
for prop, schema in props.items():
|
||||
# add parent property if not overridden by children type
|
||||
if not self.properties or \
|
||||
prop not in self.properties.keys():
|
||||
prop not in self.properties.keys():
|
||||
properties.append(PropertyDef(prop, None, schema))
|
||||
return properties
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ class GroupType(StatefulEntityType):
|
|||
'metadata' % (meta_data.get('type'))))
|
||||
for entry_schema, entry_schema_type in meta_data.items():
|
||||
if isinstance(entry_schema_type, dict) and not \
|
||||
entry_schema_type.get('type') == 'string':
|
||||
entry_schema_type.get('type') == 'string':
|
||||
ExceptionCollector.appendException(
|
||||
InvalidTypeError(what='"%s" defined in group for '
|
||||
'metadata "%s"'
|
||||
|
|
|
@ -112,7 +112,7 @@ class PolicyType(StatefulEntityType):
|
|||
|
||||
for entry_schema, entry_schema_type in meta_data.items():
|
||||
if isinstance(entry_schema_type, dict) and not \
|
||||
entry_schema_type.get('type') == 'string':
|
||||
entry_schema_type.get('type') == 'string':
|
||||
ExceptionCollector.appendException(
|
||||
InvalidTypeError(what='"%s" defined in policy for '
|
||||
'metadata "%s"'
|
||||
|
|
|
@ -58,7 +58,7 @@ class PortSpec(object):
|
|||
|
||||
# verify one of the specified values is set
|
||||
if source is None and source_range is None and \
|
||||
target is None and target_range is None:
|
||||
target is None and target_range is None:
|
||||
ExceptionCollector.appendException(
|
||||
InvalidTypeAdditionalRequirementsError(
|
||||
type=PortSpec.TYPE_URI))
|
||||
|
|
|
@ -205,7 +205,7 @@ class GetAttribute(Function):
|
|||
def _find_node_template_containing_attribute(self):
|
||||
node_tpl = self._find_node_template(self.args[0])
|
||||
if node_tpl and \
|
||||
not self._attribute_exists_in_type(node_tpl.type_definition):
|
||||
not self._attribute_exists_in_type(node_tpl.type_definition):
|
||||
ExceptionCollector.appendException(
|
||||
KeyError(_('Attribute "%(att)s" was not found in node '
|
||||
'template "%(ntpl)s".') %
|
||||
|
@ -229,7 +229,7 @@ class GetAttribute(Function):
|
|||
target_type = target_node.type_definition
|
||||
for capability in target_type.get_capabilities_objects():
|
||||
if capability.type in \
|
||||
hosted_on_rel['valid_target_types']:
|
||||
hosted_on_rel['valid_target_types']:
|
||||
if self._attribute_exists_in_type(target_type):
|
||||
return target_node
|
||||
return self._find_host_containing_attribute(
|
||||
|
|
|
@ -221,7 +221,7 @@ class ImportsLoader(object):
|
|||
dir_path = os.path.dirname(os.path.abspath(
|
||||
self.path))
|
||||
if file_path[0] != '' and dir_path.endswith(
|
||||
file_path[0]):
|
||||
file_path[0]):
|
||||
import_template = dir_path + "/" +\
|
||||
file_path[2]
|
||||
if not os.path.isfile(import_template):
|
||||
|
|
|
@ -229,7 +229,7 @@ class NodeTemplate(EntityTemplate):
|
|||
for value in occurrences:
|
||||
DataEntity.validate_datatype('integer', value)
|
||||
if len(occurrences) != 2 or not (0 <= occurrences[0] <= occurrences[1]) \
|
||||
or occurrences[1] == 0:
|
||||
or occurrences[1] == 0:
|
||||
ExceptionCollector.appendException(
|
||||
InvalidPropertyValueError(what=(occurrences)))
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class TopologyTemplate(object):
|
|||
input.validate(default)
|
||||
if (self.parsed_params and input.name not in self.parsed_params
|
||||
or self.parsed_params is None) and input.required \
|
||||
and input.default is None:
|
||||
and input.default is None:
|
||||
exception.ExceptionCollector.appendException(
|
||||
exception.MissingRequiredParameterError(
|
||||
what='Template',
|
||||
|
@ -153,7 +153,7 @@ class TopologyTemplate(object):
|
|||
if member_names is not None:
|
||||
DataEntity.validate_datatype('list', member_names)
|
||||
if len(member_names) < 1 or \
|
||||
len(member_names) != len(set(member_names)):
|
||||
len(member_names) != len(set(member_names)):
|
||||
exception.ExceptionCollector.appendException(
|
||||
exception.InvalidGroupTargetException(
|
||||
message=_('Member nodes "%s" should be >= 1 '
|
||||
|
@ -292,7 +292,7 @@ class TopologyTemplate(object):
|
|||
for interface in rel_tpl.interfaces:
|
||||
if interface.inputs:
|
||||
for name, value in \
|
||||
interface.inputs.items():
|
||||
interface.inputs.items():
|
||||
interface.inputs[name] = \
|
||||
functions.get_function(self,
|
||||
rel_tpl,
|
||||
|
|
|
@ -198,7 +198,7 @@ class TOSCAVersionProperty(object):
|
|||
"""
|
||||
|
||||
if self.minor_version is None and self.build_version is None and \
|
||||
value != '0':
|
||||
value != '0':
|
||||
log.warning(_('Minor version assumed "0".'))
|
||||
self.version = '.'.join([value, '0'])
|
||||
return value
|
||||
|
|
3
tox.ini
3
tox.ini
|
@ -28,9 +28,6 @@ commands = python setup.py build_sphinx
|
|||
commands = oslo_debug_helper -t toscaparser/tests {posargs}
|
||||
|
||||
[flake8]
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
|
||||
show-source = True
|
||||
ignore = E123,E125
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||
|
|
Loading…
Reference in New Issue