diff options
author | Andreas Jaeger <aj@suse.com> | 2020-04-09 12:29:09 +0200 |
---|---|---|
committer | Andreas Jaeger <aj@suse.com> | 2020-04-16 08:41:49 +0200 |
commit | a27dc56f525606c1ec1046e5c1f9cc57ca1f9f11 (patch) | |
tree | 909b5b2361ebd93e071ce4410a5249da2f79e26e /heat | |
parent | ab69088d041b2e50e8afcde83eb77d615568da21 (diff) | |
download | heat-a27dc56f525606c1ec1046e5c1f9cc57ca1f9f11.tar.gz |
Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Update local hacking checks for new flake8.
Ignore new warnings, they will be fixed in followup.
Remove hacking and friends from lower-constraints, they are not needed
to be installed at run-time.
Add Pygments to lower-constraints to pass requirements-check.
Change-Id: I20da1309e4d65707130fe517f013d3ed625bf94c
Diffstat (limited to 'heat')
-rw-r--r-- | heat/hacking/checks.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/heat/hacking/checks.py b/heat/hacking/checks.py index dade30bb2..4c3943538 100644 --- a/heat/hacking/checks.py +++ b/heat/hacking/checks.py @@ -15,6 +15,8 @@ import re +from hacking import core + """ Guidelines for writing new hacking checks @@ -31,6 +33,7 @@ Guidelines for writing new hacking checks """ +@core.flake8ext def no_log_warn(logical_line): """Disallow 'LOG.warn(' @@ -42,6 +45,7 @@ def no_log_warn(logical_line): yield(0, 'Heat301 Use LOG.warning() rather than LOG.warn()') +@core.flake8ext def check_python3_no_iteritems(logical_line): msg = ("Heat302: Use dict.items() instead of dict.iteritems().") @@ -49,6 +53,7 @@ def check_python3_no_iteritems(logical_line): yield(0, msg) +@core.flake8ext def check_python3_no_iterkeys(logical_line): msg = ("Heat303: Use dict.keys() instead of dict.iterkeys().") @@ -56,15 +61,9 @@ def check_python3_no_iterkeys(logical_line): yield(0, msg) +@core.flake8ext def check_python3_no_itervalues(logical_line): msg = ("Heat304: Use dict.values() instead of dict.itervalues().") if re.search(r".*\.itervalues\(\)", logical_line): yield(0, msg) - - -def factory(register): - register(no_log_warn) - register(check_python3_no_iteritems) - register(check_python3_no_iterkeys) - register(check_python3_no_itervalues) |