diff --git a/HACKING.rst b/HACKING.rst index ef4e5850f1..8196a3daf5 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -16,7 +16,6 @@ Manila Specific Commandments included in translated message. - [M336] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs. -- [M337] Ensure to not use xrange(). - [M338] Ensure to not use LOG.warn(). - [M354] Use oslo_utils.uuidutils to generate UUID instead of uuid4(). - [M359] Validate that log messages are not translated. diff --git a/manila/tests/hacking/checks.py b/manila/tests/hacking/checks.py index b06f1d1687..ec62f40119 100644 --- a/manila/tests/hacking/checks.py +++ b/manila/tests/hacking/checks.py @@ -47,7 +47,6 @@ underscore_import_check_multi = re.compile(r"(.)*import (.)*_, (.)*") # We need this for cases where they have created their own _ function. custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*") dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)") -assert_no_xrange_re = re.compile(r"\s*xrange\s*\(") assert_True = re.compile(r".*assertEqual\(True, .*\)") no_log_warn = re.compile(r"\s*LOG.warn\(.*") @@ -225,12 +224,6 @@ def dict_constructor_with_list_copy(logical_line): yield (0, msg) -@core.flake8ext -def no_xrange(logical_line): - if assert_no_xrange_re.match(logical_line): - yield (0, "M337: Do not use xrange().") - - @core.flake8ext def validate_assertTrue(logical_line): if re.match(assert_True, logical_line): diff --git a/manila/tests/test_hacking.py b/manila/tests/test_hacking.py index 6c12bc98e1..cce2beb287 100644 --- a/manila/tests/test_hacking.py +++ b/manila/tests/test_hacking.py @@ -222,11 +222,6 @@ class HackingTestCase(test.TestCase): self.assertEqual(0, len(list(checks.dict_constructor_with_list_copy( " self._render_dict(xml, data_el, data.__dict__)")))) - def test_no_xrange(self): - self.assertEqual(1, len(list(checks.no_xrange("xrange(45)")))) - - self.assertEqual(0, len(list(checks.no_xrange("range(45)")))) - def test_validate_assertTrue(self): test_value = True self.assertEqual(0, len(list(checks.validate_assertTrue( diff --git a/tox.ini b/tox.ini index 61acabe2b5..d672d686f5 100644 --- a/tox.ini +++ b/tox.ini @@ -162,7 +162,6 @@ extension = M323 = checks:check_explicit_underscore_import M326 = checks:CheckForTransAdd M336 = checks:dict_constructor_with_list_copy - M337 = checks:no_xrange M338 = checks:no_log_warn_check M354 = checks:check_uuid4 M359 = checks:no_translate_logs