Browse Source

Merge "Update local hacking checks"

tags/0.46.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
9d86cc6edf
2 changed files with 8 additions and 7 deletions
  1. +3
    -4
      openstack/_hacking.py
  2. +5
    -3
      tox.ini

+ 3
- 4
openstack/_hacking.py 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)

+ 5
- 3
tox.ini 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



Loading…
Cancel
Save