summaryrefslogtreecommitdiff
path: root/ironic/hacking
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-03-28 12:00:14 +0100
committerRiccardo Pittau <elfosardo@gmail.com>2020-03-31 10:16:54 +0200
commita3d7d73a69f85b396aad30610294d5ea246a0df7 (patch)
tree22240a462f0986eba38f919b25665318fb929fdd /ironic/hacking
parent4829df2966190595feb69623792678816bdcd6a2 (diff)
downloadironic-a3d7d73a69f85b396aad30610294d5ea246a0df7.tar.gz
Bump hacking to 3.0.0
The new version enables a lot of standard flake8 checks. Some of them are temporary disabled to reduce the scope of this patch: * Complexity check requires a few functions to be rewritten (apparently, it was not enabled previously). * Indentation check failures are numerous and potentially contradictive. These checks will be enabled in follow-ups. W606 is removed from excludes since we no longer hit it. Change-Id: I1e5a6f8e5e90c55cfc6f740b26c30196512d3be3
Diffstat (limited to 'ironic/hacking')
-rw-r--r--ironic/hacking/checks.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/ironic/hacking/checks.py b/ironic/hacking/checks.py
index 6c2ac23fd..1d59efb37 100644
--- a/ironic/hacking/checks.py
+++ b/ironic/hacking/checks.py
@@ -14,6 +14,8 @@
import re
+from hacking import core
+
# N323: Found use of _() without explicit import of _!
@@ -29,6 +31,7 @@ underscore_import_check = re.compile(r"(.)*import _(.)*")
custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*")
+@core.flake8ext
def check_explicit_underscore_import(logical_line, filename):
"""Check for explicit import of the _ function
@@ -49,7 +52,3 @@ def check_explicit_underscore_import(logical_line, filename):
elif (translated_log.match(logical_line) or
string_translation.match(logical_line)):
yield(0, "N323: Found use of _() without explicit import of _!")
-
-
-def factory(register):
- register(check_explicit_underscore_import)