From e56e6b6b0f8e25c327d95107fe95183332c77bfc Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Wed, 19 Jul 2017 13:43:44 +0200 Subject: [PATCH] hacking: Remove dead code Checks for logs translation were removed. Code in this patch is not used anywhere. Change-Id: Ia8b6ce545ed0182825fc9d32eedfdf7b949c27d0 --- HACKING.rst | 1 - neutron/hacking/checks.py | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index 548a549d8cb..23fed1f769a 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -14,7 +14,6 @@ while other rules are specific to Neutron 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 - [N328] Detect wrong usage with assertEqual - [N330] Use assertEqual(*empty*, observed) instead of diff --git a/neutron/hacking/checks.py b/neutron/hacking/checks.py index ab3122c061f..8e872b59330 100644 --- a/neutron/hacking/checks.py +++ b/neutron/hacking/checks.py @@ -41,25 +41,6 @@ def flake8ext(f): # - Add test cases for each new rule to # 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_from = re.compile(r"\bfrom[\s]+unittest\b")