diff --git a/HACKING.rst b/HACKING.rst index 92853346..52844ae4 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -16,7 +16,6 @@ Cloudkitty Specific Commandments included in translated message. - [C318] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs. -- [C319] Ensure to not use xrange(). - [C320] Do not use LOG.warn as it's deprecated. - [C321] Ensure that the _() function is explicitly imported to ensure proper translations. diff --git a/cloudkitty/hacking/checks.py b/cloudkitty/hacking/checks.py index 286815bb..68bc1827 100644 --- a/cloudkitty/hacking/checks.py +++ b/cloudkitty/hacking/checks.py @@ -47,11 +47,7 @@ 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, .*\)") -assert_None = re.compile(r".*assertEqual\(None, .*\)") no_log_warn = re.compile(r".*LOG.warn\(.*\)") -asse_raises_regexp = re.compile(r"assertRaisesRegexp\(") class BaseASTChecker(ast.NodeVisitor): @@ -294,16 +290,6 @@ def dict_constructor_with_list_copy(logical_line): yield (0, msg) -@core.flake8ext -def no_xrange(logical_line): - """Ensure to not use xrange() - - C319 - """ - if assert_no_xrange_re.match(logical_line): - yield (0, "C319: Do not use xrange().") - - @core.flake8ext def no_log_warn_check(logical_line): """Disallow 'LOG.warn' diff --git a/cloudkitty/tests/test_hacking.py b/cloudkitty/tests/test_hacking.py index 6f0f3cbd..896d2c71 100644 --- a/cloudkitty/tests/test_hacking.py +++ b/cloudkitty/tests/test_hacking.py @@ -280,11 +280,6 @@ class HackingTestCase(tests.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_no_log_warn_check(self): self.assertEqual(0, len(list(checks.no_log_warn_check( "LOG.warning('This should not trigger LOG.warn" diff --git a/tox.ini b/tox.ini index 858f62c9..e88bc125 100644 --- a/tox.ini +++ b/tox.ini @@ -99,7 +99,6 @@ extension = C314 = checks:CheckForStrUnicodeExc C315 = checks:CheckForTransAdd C318 = checks:dict_constructor_with_list_copy - C319 = checks:no_xrange C320 = checks:no_log_warn_check C321 = checks:check_explicit_underscore_import paths = ./cloudkitty/hacking