From ec4833b206c23b0b6f9c6b101c70ab925a5e9c67 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 17 Apr 2013 16:11:41 -0700 Subject: [PATCH] Remove H307 no db in virt This is a Nova only rule that shouldn't be in the generic hacking tool Change-Id: Ibdba7319a1bf08fb917aaac8503203a857f08b83 Reviewed-on: https://review.openstack.org/27090 Reviewed-by: Jeremy Stanley Approved: Doug Hellmann Reviewed-by: Doug Hellmann Tested-by: Jenkins --- README.rst | 1 - hacking/core.py | 14 -------------- setup.cfg | 1 - 3 files changed, 16 deletions(-) diff --git a/README.rst b/README.rst index eb8af6ff..68e770b5 100644 --- a/README.rst +++ b/README.rst @@ -59,7 +59,6 @@ Imports - Do not import more than one module per line (*) - Do not use wildcard ``*`` import (*) - Do not make relative imports -- Do not make new nova.db imports in nova/virt/* - Order your imports by the full module path - Organize your imports according to the following template diff --git a/hacking/core.py b/hacking/core.py index db9714d6..87c6adbb 100755 --- a/hacking/core.py +++ b/hacking/core.py @@ -274,20 +274,6 @@ def hacking_import_alphabetical(logical_line, blank_lines, previous_logical, % (split_previous[1], split_line[1])) -@flake8ext -def hacking_import_no_db_in_virt(logical_line, filename): - """Check for db calls from nova/virt - - As of grizzly-2 all the database calls have been removed from - nova/virt, and we want to keep it that way. - - H307 - """ - if "nova/virt" in filename and not filename.endswith("fake.py"): - if logical_line.startswith("from nova import db"): - yield (0, "H307: nova.db import not allowed in nova/virt/*") - - def is_docstring(physical_line, previous_logical): """Return True if found docstring 'A docstring is a string literal that occurs as the first statement in a diff --git a/setup.cfg b/setup.cfg index 5725d7c4..aaf3907b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,6 @@ flake8.extension = H202 = hacking.core:hacking_except_format_assert H301 = hacking.core:hacking_import_rules H306 = hacking.core:hacking_import_alphabetical - H307 = hacking.core:hacking_import_no_db_in_virt H401 = hacking.core:hacking_docstring_start_space H402 = hacking.core:hacking_docstring_one_line H403 = hacking.core:hacking_docstring_multiline_end