From 631e5519cad6fa0b93780f7310ba1d771f80adae Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 23 Mar 2015 15:46:57 +0900 Subject: [PATCH] Fix E265 block comment should start with '# ' All E265 errors are now fixed and remove it from ignore list. Change-Id: I09ada4cc0f33cae5da4cbc29a4e843e3ce14e111 --- neutronclient/common/serializer.py | 10 +++------- neutronclient/neutron/v2_0/contrib/_fox_sockets.py | 2 +- .../tests/unit/fw/test_cli20_firewallpolicy.py | 2 +- tox.ini | 3 +-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/neutronclient/common/serializer.py b/neutronclient/common/serializer.py index 0a016d17a..3293b88a4 100644 --- a/neutronclient/common/serializer.py +++ b/neutronclient/common/serializer.py @@ -12,10 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -### -### Codes from neutron wsgi -### import logging from xml.etree import ElementTree as etree @@ -126,7 +122,7 @@ class XMLDictSerializer(DictSerializer): self._add_xmlns(node, used_prefixes, has_atom) return etree.tostring(node, encoding='UTF-8') - #NOTE (ameade): the has_atom should be removed after all of the + # NOTE(ameade): the has_atom should be removed after all of the # XML serializers and view builders have been updated to the current # spec that required all responses include the xmlns:atom, the has_atom # flag is to prevent current tests from breaking @@ -146,7 +142,7 @@ class XMLDictSerializer(DictSerializer): result = etree.SubElement(parent, nodename) if ":" in nodename: used_prefixes.append(nodename.split(":", 1)[0]) - #TODO(bcwaldon): accomplish this without a type-check + # TODO(bcwaldon): accomplish this without a type-check if isinstance(data, list): if not data: result.set( @@ -162,7 +158,7 @@ class XMLDictSerializer(DictSerializer): for item in data: self._to_xml_node(result, metadata, singular, item, used_prefixes) - #TODO(bcwaldon): accomplish this without a type-check + # TODO(bcwaldon): accomplish this without a type-check elif isinstance(data, dict): if not data: result.set( diff --git a/neutronclient/neutron/v2_0/contrib/_fox_sockets.py b/neutronclient/neutron/v2_0/contrib/_fox_sockets.py index da88eb124..63996981b 100644 --- a/neutronclient/neutron/v2_0/contrib/_fox_sockets.py +++ b/neutronclient/neutron/v2_0/contrib/_fox_sockets.py @@ -65,7 +65,7 @@ class FoxInSocketsUpdate(extension.ClientExtensionUpdate, FoxInSocket): list_columns = ['id', 'name'] def add_known_arguments(self, parser): - #_add_updatable_args(parser) + # _add_updatable_args(parser) parser.add_argument( '--name', help=_('Name of this fox socket.')) diff --git a/neutronclient/tests/unit/fw/test_cli20_firewallpolicy.py b/neutronclient/tests/unit/fw/test_cli20_firewallpolicy.py index 243843a00..703b7cd2e 100644 --- a/neutronclient/tests/unit/fw/test_cli20_firewallpolicy.py +++ b/neutronclient/tests/unit/fw/test_cli20_firewallpolicy.py @@ -57,7 +57,7 @@ class CLITestV20FirewallPolicyJSON(test_cli20.CLITestV20Base): position_names = ['name', ] position_values = [name, ] - #check for both str and unicode format firewall_rules_arg + # check for both str and unicode format firewall_rules_arg for firewall_rules_arg in ['rule_id1 rule_id2', u'rule_id1 rule_id2']: args = ['--description', description, '--shared', diff --git a/tox.ini b/tox.ini index e59202421..b6c33c6b5 100644 --- a/tox.ini +++ b/tox.ini @@ -40,8 +40,7 @@ downloadcache = ~/cache/pip # E125 continuation line does not distinguish itself from next logical line # # TODO Fix the following rules from hacking 0.9.x -# E265 block comment should start with '# ' # H405 multi line docstring summary not separated with an empty line -ignore = E125,E265,H405 +ignore = E125,H405 show-source = true exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools