hacking: Remove dead code
Checks for logs translation were removed. Code in this patch is not used anywhere. Change-Id: Ia8b6ce545ed0182825fc9d32eedfdf7b949c27d0
This commit is contained in:
parent
9449a63021
commit
e56e6b6b0f
@ -14,7 +14,6 @@ while other rules are specific to Neutron repository.
|
|||||||
|
|
||||||
Below you can find a list of checks specific to this repository.
|
Below you can find a list of checks specific to this repository.
|
||||||
|
|
||||||
- [N320] Validate that LOG messages, except debug ones, have translations
|
|
||||||
- [N322] Detect common errors with assert_called_once_with
|
- [N322] Detect common errors with assert_called_once_with
|
||||||
- [N328] Detect wrong usage with assertEqual
|
- [N328] Detect wrong usage with assertEqual
|
||||||
- [N330] Use assertEqual(*empty*, observed) instead of
|
- [N330] Use assertEqual(*empty*, observed) instead of
|
||||||
|
@ -41,25 +41,6 @@ def flake8ext(f):
|
|||||||
# - Add test cases for each new rule to
|
# - Add test cases for each new rule to
|
||||||
# neutron/tests/unit/hacking/test_checks.py
|
# neutron/tests/unit/hacking/test_checks.py
|
||||||
|
|
||||||
_all_log_levels = {
|
|
||||||
'reserved': '_', # this should never be used with a log unless
|
|
||||||
# it is a variable used for a log message and
|
|
||||||
# a exception
|
|
||||||
'error': '_LE',
|
|
||||||
'info': '_LI',
|
|
||||||
'warning': '_LW',
|
|
||||||
'critical': '_LC',
|
|
||||||
'exception': '_LE',
|
|
||||||
}
|
|
||||||
_all_hints = set(_all_log_levels.values())
|
|
||||||
|
|
||||||
|
|
||||||
def _regex_for_level(level, hint):
|
|
||||||
return r".*LOG\.%(level)s\(\s*((%(wrong_hints)s)\(|'|\")" % {
|
|
||||||
'level': level,
|
|
||||||
'wrong_hints': '|'.join(_all_hints - set([hint])),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unittest_imports_dot = re.compile(r"\bimport[\s]+unittest\b")
|
unittest_imports_dot = re.compile(r"\bimport[\s]+unittest\b")
|
||||||
unittest_imports_from = re.compile(r"\bfrom[\s]+unittest\b")
|
unittest_imports_from = re.compile(r"\bfrom[\s]+unittest\b")
|
||||||
|
Loading…
Reference in New Issue
Block a user