diff --git a/HACKING.rst b/HACKING.rst index 61fee650f9..d6b25c7523 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -16,12 +16,6 @@ glance Specific Commandments assertIsNone(A) - [G319] Validate that debug level logs are not translated - [G320] For python 3 compatibility, use six.text_type() instead of unicode() -- [G321] Validate that LOG messages, except debug ones, have translations -- [G322] Validate that LOG.info messages use _LI. -- [G323] Validate that LOG.exception messages use _LE. -- [G324] Validate that LOG.error messages use _LE. -- [G325] Validate that LOG.critical messages use _LC. -- [G326] Validate that LOG.warning messages use _LW. - [G327] Prevent use of deprecated contextlib.nested - [G328] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs - [G329] Python 3: Do not use xrange. diff --git a/glance/hacking/checks.py b/glance/hacking/checks.py index 66f89490fa..dfc92672fe 100644 --- a/glance/hacking/checks.py +++ b/glance/hacking/checks.py @@ -14,8 +14,6 @@ import re -import pep8 - """ Guidelines for writing new hacking checks @@ -116,30 +114,6 @@ def no_direct_use_of_unicode_function(logical_line): yield(0, "G320: Use six.text_type() instead of unicode()") -def validate_log_translations(logical_line, physical_line, filename): - # Translations are not required in the test directory - if pep8.noqa(physical_line): - return - msg = "G322: LOG.info messages require translations `_LI()`!" - if log_translation_info.match(logical_line): - yield (0, msg) - msg = "G323: LOG.exception messages require translations `_LE()`!" - if log_translation_exception.match(logical_line): - yield (0, msg) - msg = "G324: LOG.error messages require translations `_LE()`!" - if log_translation_error.match(logical_line): - yield (0, msg) - msg = "G325: LOG.critical messages require translations `_LC()`!" - if log_translation_critical.match(logical_line): - yield (0, msg) - msg = "G326: LOG.warning messages require translations `_LW()`!" - if log_translation_warning.match(logical_line): - yield (0, msg) - msg = "G321: Log messages require translations!" - if log_translation.match(logical_line): - yield (0, msg) - - def check_no_contextlib_nested(logical_line): msg = ("G327: contextlib.nested is deprecated since Python 2.7. See " "https://docs.python.org/2/library/contextlib.html#contextlib." @@ -189,7 +163,6 @@ def factory(register): register(assert_equal_none) register(no_translate_debug_logs) register(no_direct_use_of_unicode_function) - register(validate_log_translations) register(check_no_contextlib_nested) register(dict_constructor_with_list_copy) register(check_python3_xrange)