From a789257e9e48fe760496a6a88536bf1c5017127f Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Mon, 30 Mar 2020 15:36:12 +0200 Subject: [PATCH] Bump hacking to 3.0.0 The new version enables a lot of standard flake8 checks, so a few fixes are required. W503 is disabled as it conflicts with W504 and the latter seems to be preferred nowadays. Change-Id: Ic1efc86ec41daf6fadb4cebb8a73b4dd158f880a --- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 4 +++- virtualbmc/manager.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 3b5955c..6a5b1dc 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -12,7 +12,7 @@ extras==1.0.0 fixtures==3.0.0 flake8==2.5.5 future==0.16.0 -hacking==0.12.0 +hacking==3.0.0 imagesize==0.7.1 iso8601==0.1.11 Jinja2==2.10 diff --git a/test-requirements.txt b/test-requirements.txt index 591ac54..b478a2a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=3.0.0,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 8fc7529..c8ec705 100644 --- a/tox.ini +++ b/tox.ini @@ -55,7 +55,9 @@ commands = commands = oslo_debug_helper {posargs} [flake8] -ignore = E129 +# [E129] Visually indented line with same indent as next logical line. +# [W503] Line break occurred before a binary operator. Conflicts with W504. +ignore = E129,W503 exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build max-complexity=17 diff --git a/virtualbmc/manager.py b/virtualbmc/manager.py index 221b22a..40a5241 100644 --- a/virtualbmc/manager.py +++ b/virtualbmc/manager.py @@ -97,8 +97,8 @@ class VirtualBMCManager(object): except Exception: currently_enabled = False - if (lets_enable is not None and - lets_enable != currently_enabled): + if (lets_enable is not None + and lets_enable != currently_enabled): config.update(active=lets_enable) self._store_config(**config) currently_enabled = lets_enable