Remove old hacking check for oslo namespace package
The oslo namespace package was removed long ago and can't be used any more. Change-Id: I8026fddbf40e208c85888e3f57a3b951763d8039 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -14,7 +14,6 @@ Manila Specific Commandments
|
||||
- [M323] Ensure that the _() function is explicitly imported to ensure proper translations.
|
||||
- [M326] Translated messages cannot be concatenated. String should be
|
||||
included in translated message.
|
||||
- [M333] ``oslo_`` should be used instead of ``oslo.``
|
||||
- [M336] Must use a dict comprehension instead of a dict constructor
|
||||
with a sequence of key-value pairs.
|
||||
- [M337] Ensure to not use xrange().
|
||||
|
||||
@@ -46,7 +46,6 @@ underscore_import_check = re.compile(r"(.)*import _$")
|
||||
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*(.)*")
|
||||
oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](.*)")
|
||||
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, .*\)")
|
||||
@@ -217,17 +216,6 @@ class CheckForTransAdd(BaseASTChecker):
|
||||
super(CheckForTransAdd, self).generic_visit(node)
|
||||
|
||||
|
||||
@core.flake8ext
|
||||
def check_oslo_namespace_imports(logical_line, filename, noqa):
|
||||
if noqa:
|
||||
return
|
||||
if re.match(oslo_namespace_imports, logical_line):
|
||||
msg = ("M333: '%s' must be used instead of '%s'.") % (
|
||||
logical_line.replace('oslo.', 'oslo_'),
|
||||
logical_line)
|
||||
yield (0, msg)
|
||||
|
||||
|
||||
@core.flake8ext
|
||||
def dict_constructor_with_list_copy(logical_line):
|
||||
msg = ("M336: Must use a dict comprehension instead of a dict constructor"
|
||||
|
||||
@@ -161,7 +161,6 @@ extension =
|
||||
M313 = checks:validate_assertTrue
|
||||
M323 = checks:check_explicit_underscore_import
|
||||
M326 = checks:CheckForTransAdd
|
||||
M333 = checks:check_oslo_namespace_imports
|
||||
M336 = checks:dict_constructor_with_list_copy
|
||||
M337 = checks:no_xrange
|
||||
M338 = checks:no_log_warn_check
|
||||
|
||||
Reference in New Issue
Block a user