Update local hacking checks

Update local hacking checks for new flake8.

Change-Id: I1031badf36857a22efcd6ce6124f9db48bc18995
This commit is contained in:
Andreas Jaeger 2020-03-29 12:13:35 +02:00 committed by Monty Taylor
parent 8ca613e43f
commit a0d75007a8
2 changed files with 8 additions and 7 deletions

View File

@ -14,6 +14,8 @@
import re
from hacking import core
"""
Guidelines for writing new hacking checks
@ -31,6 +33,7 @@ Guidelines for writing new hacking checks
SETUPCLASS_RE = re.compile(r"def setUpClass\(")
@core.flake8ext
def assert_no_setupclass(logical_line):
"""Check for use of setUpClass
@ -38,7 +41,3 @@ def assert_no_setupclass(logical_line):
"""
if SETUPCLASS_RE.match(logical_line):
yield (0, "O300: setUpClass not allowed")
def factory(register):
register(assert_no_setupclass)

View File

@ -45,9 +45,6 @@ commands =
flake8
doc8 doc/source README.rst
[hacking]
local-check-factory = openstack._hacking.factory
[testenv:venv]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
@ -119,6 +116,11 @@ ignore = H306,H4,W503
show-source = True
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]
extensions = .rst, .yaml