From ba9d4ca9561356a34077fe435fb4e9855625d072 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 31 Mar 2020 11:04:38 +0100 Subject: [PATCH] trivial: Remove some rules from flake8 ignore list Most of these were either unnecessary or trivial to resolve. Change-Id: I2952e4906a511f6ffc6c53dc1c582464000e22de Signed-off-by: Stephen Finucane --- tox.ini | 26 ++++--------------- .../tests/unit/test_linux_net.py | 2 +- vif_plug_ovs/ovs.py | 6 ++--- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/tox.ini b/tox.ini index 6d96849f..2cfe1ab5 100644 --- a/tox.ini +++ b/tox.ini @@ -61,30 +61,14 @@ commands = # E123, E125 skipped as they are invalid PEP-8. # Following checks are ignored on purpose. # -# E251 unexpected spaces around keyword / parameter equals -# reason: no improvement in readability -# -# E265 block comment should start with '# ' -# reason: no improvement in readability -# -# H904 wrap long lines in parentheses instead of a backslash -# reason: removed in hacking (https://review.opendev.org/#/c/101701/) -# -# H404 skipped on purpose per jay pipes discussion. -# +# H404, H405 skipped on purpose per jay pipes discussion. # W504 line break after binary operator -# -# Due to the upgrade to hacking 0.9.2 the following checking are -# ignored on purpose for the moment and should be re-enabled. -# H106: Don’t put vim configuration in source files -# H203: Use assertIs(Not)None to check for None - show-source = True -ignore = E123,E125,E126,E127,E128,E251,E265,H302,H405,H904,H404,W504 -enable-extensions=H106,H203 +ignore = E123,E125,E126,E127,E128,H404,H405,W504 +enable-extensions = H106,H203 builtins = _ -exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build -max-complexity=30 +exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build +max-complexity = 30 [hacking] import_exceptions = os_vif.i18n diff --git a/vif_plug_linux_bridge/tests/unit/test_linux_net.py b/vif_plug_linux_bridge/tests/unit/test_linux_net.py index 6daed382..648ae9b9 100644 --- a/vif_plug_linux_bridge/tests/unit/test_linux_net.py +++ b/vif_plug_linux_bridge/tests/unit/test_linux_net.py @@ -130,7 +130,7 @@ class LinuxNetTest(testtools.TestCase): calls = [mock.call('fake-interface', 1500), mock.call('fake-bridge', 1500)] mock_set_mtu.assert_has_calls(calls) - calls = [mock.call('fake-bridge', state = 'up'), + calls = [mock.call('fake-bridge', state='up'), mock.call('fake-interface', master='fake-bridge', state='up', check_exit_code=[0, 2, 254])] mock_ip_set.assert_has_calls(calls) diff --git a/vif_plug_ovs/ovs.py b/vif_plug_ovs/ovs.py index 9516f79f..180bc4c2 100644 --- a/vif_plug_ovs/ovs.py +++ b/vif_plug_ovs/ovs.py @@ -100,14 +100,12 @@ class OvsPlugin(plugin.PluginBase): def describe(self): pp_ovs = objects.host_info.HostPortProfileInfo( - profile_object_name= - objects.vif.VIFPortProfileOpenVSwitch.__name__, + profile_object_name=objects.vif.VIFPortProfileOpenVSwitch.__name__, # noqa min_version="1.0", max_version="1.0", ) pp_ovs_representor = objects.host_info.HostPortProfileInfo( - profile_object_name= - objects.vif.VIFPortProfileOVSRepresentor.__name__, + profile_object_name=objects.vif.VIFPortProfileOVSRepresentor.__name__, # noqa min_version="1.0", max_version="1.0", )