]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Enable pylint checks for "anomalous" string escapes
authorAngus Lees <gus@inodes.org>
Wed, 22 Oct 2014 10:20:23 +0000 (21:20 +1100)
committerAngus Lees <gus@inodes.org>
Tue, 23 Dec 2014 03:53:02 +0000 (14:53 +1100)
commite9cee51e56504800ebc51226deb059cf574e3d13
treea5af9a7847d62a1eceb5c466510df024a0d1e777
parentd51bb9b4d0588d330a1d97dcc8d441c9dac500ae
Enable pylint checks for "anomalous" string escapes

Escapes in python string literals are well defined, but can be
confusing.  These pylint checks look for backslash escapes in strings
that might be mistakes.  Two code refactors were required to satisfy
these tests:

1. midonet_lib.py used \**kwargs in docstrings.

There doesn't seem to be a sphinx standard for kwargs, so this change
simply replaces them with "kwargs".

2. Regex literals containing escapes replaced with r''.

The assumption with this change (and the underlying pylint
check) is that r'' literals are more straightforward for regular
expressions, where every backslash is important.

While looking at these regexes, this change also removes a few
unnecessary "\-" escapes.

Change-Id: I01528b2482f78b9e851685ebbf6fded4e58355f1
.pylintrc
neutron/agent/linux/ip_link_support.py
neutron/api/v2/attributes.py
neutron/extensions/loadbalancer.py
neutron/extensions/loadbalancerv2.py
neutron/plugins/bigswitch/db/consistency_db.py
neutron/plugins/midonet/midonet_lib.py
neutron/plugins/ml2/drivers/cisco/apic/apic_topology.py
neutron/plugins/sriovnicagent/eswitch_manager.py
neutron/policy.py