Update local hacking checks
Update local hacking checks for new flake8. Change-Id: I1031badf36857a22efcd6ce6124f9db48bc18995
This commit is contained in:
parent
8ca613e43f
commit
a0d75007a8
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from hacking import core
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Guidelines for writing new hacking checks
|
Guidelines for writing new hacking checks
|
||||||
|
|
||||||
|
@ -31,6 +33,7 @@ Guidelines for writing new hacking checks
|
||||||
SETUPCLASS_RE = re.compile(r"def setUpClass\(")
|
SETUPCLASS_RE = re.compile(r"def setUpClass\(")
|
||||||
|
|
||||||
|
|
||||||
|
@core.flake8ext
|
||||||
def assert_no_setupclass(logical_line):
|
def assert_no_setupclass(logical_line):
|
||||||
"""Check for use of setUpClass
|
"""Check for use of setUpClass
|
||||||
|
|
||||||
|
@ -38,7 +41,3 @@ def assert_no_setupclass(logical_line):
|
||||||
"""
|
"""
|
||||||
if SETUPCLASS_RE.match(logical_line):
|
if SETUPCLASS_RE.match(logical_line):
|
||||||
yield (0, "O300: setUpClass not allowed")
|
yield (0, "O300: setUpClass not allowed")
|
||||||
|
|
||||||
|
|
||||||
def factory(register):
|
|
||||||
register(assert_no_setupclass)
|
|
||||||
|
|
8
tox.ini
8
tox.ini
|
@ -45,9 +45,6 @@ commands =
|
||||||
flake8
|
flake8
|
||||||
doc8 doc/source README.rst
|
doc8 doc/source README.rst
|
||||||
|
|
||||||
[hacking]
|
|
||||||
local-check-factory = openstack._hacking.factory
|
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||||
|
@ -119,6 +116,11 @@ ignore = H306,H4,W503
|
||||||
show-source = True
|
show-source = True
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,openstack/_services_mixin.py
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,openstack/_services_mixin.py
|
||||||
|
|
||||||
|
[flake8:local-plugins]
|
||||||
|
extension =
|
||||||
|
O300 = _hacking:assert_no_setupclass
|
||||||
|
paths = ./openstack
|
||||||
|
|
||||||
[doc8]
|
[doc8]
|
||||||
extensions = .rst, .yaml
|
extensions = .rst, .yaml
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue