From 4d68bd630b59385175b39fb1b24bb76047125224 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 16 Jan 2024 18:20:05 +0900 Subject: [PATCH] Bump hacking The version currently used is too old. Change-Id: I4b8163ce2766198636924c33f9a88576cd09a96f --- octaviaclient/hacking/checks.py | 6 +++--- octaviaclient/osc/v2/validate.py | 4 ++-- test-requirements.txt | 4 ++-- tox.ini | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/octaviaclient/hacking/checks.py b/octaviaclient/hacking/checks.py index 8fab1ba..d83d8db 100644 --- a/octaviaclient/hacking/checks.py +++ b/octaviaclient/hacking/checks.py @@ -139,7 +139,7 @@ def no_log_warn(logical_line): O339 """ if logical_line.startswith('LOG.warn('): - yield(0, "O339:Use LOG.warning() rather than LOG.warn()") + yield (0, "O339:Use LOG.warning() rather than LOG.warn()") @core.flake8ext @@ -149,7 +149,7 @@ def no_xrange(logical_line): O340 """ if assert_no_xrange_re.match(logical_line): - yield(0, "O340: Do not use xrange().") + yield (0, "O340: Do not use xrange().") @core.flake8ext @@ -213,7 +213,7 @@ def check_no_basestring(logical_line): if re.search(r"\bbasestring\b", logical_line): msg = ("O343: basestring is not Python3-compatible, use " "six.string_types instead.") - yield(0, msg) + yield (0, msg) @core.flake8ext diff --git a/octaviaclient/osc/v2/validate.py b/octaviaclient/osc/v2/validate.py index 76a75f1..25bb693 100644 --- a/octaviaclient/osc/v2/validate.py +++ b/octaviaclient/osc/v2/validate.py @@ -78,8 +78,8 @@ def check_member_attrs(attrs): _validate_TCP_UDP_SCTP_port_range(attrs['member_port'], 'member-port') if 'weight' in attrs: - if(attrs['weight'] < constants.MIN_WEIGHT or - attrs['weight'] > constants.MAX_WEIGHT): + if (attrs['weight'] < constants.MIN_WEIGHT or + attrs['weight'] > constants.MAX_WEIGHT): msg = ("Invalid input for field/attribute 'weight', Value: " "'{weight}'. Value must be between {wmin} and " "{wmax}.".format(weight=attrs['weight'], diff --git a/test-requirements.txt b/test-requirements.txt index e372073..5d38791 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,13 +2,13 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=3.0.1,<3.1.0 # Apache-2.0 +hacking>=6.1.0,<6.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 Pygments>=2.2.0 # BSD license bandit!=1.6.0,>=1.1.0 # Apache-2.0 -flake8-import-order==0.12 # LGPLv3 +flake8-import-order>=0.18.0,<0.19.0 # LGPLv3 pylint>=2.5.3 # GPLv2 python-subunit>=1.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index b4b46f2..ac6310d 100644 --- a/tox.ini +++ b/tox.ini @@ -88,7 +88,8 @@ commands = [flake8] # [H104]: Empty file with only comments # [W504]: Line break after binary operator -ignore = H104,W504 +# [I202]: Additional newline in a group of imports. +ignore = H104,W504,I202 show-source = true builtins = _ exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build