Disable flake8 plugins by default
Since 9b6a1aafc3
was merged, all plugins
provided by neutron-lib are enabled automatically, as long as
neutron-lib is enabled.
This is a breaking change for any projects using neutron-lib,
especially ones outside of neutron's governance. While technically
we can ignore these checks, it'd be better to explicitly opt-in to
these checks to make sure new checks do not break pep8 check
immediately.
Closes-Bug: #2121609
Change-Id: I3a592f6170ab5215c1e0f2ebd7b9778141689932
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -43,6 +43,7 @@ assert_is_none_re = re.compile(
|
||||
r"assertIs(Not)?\(.*,\s+None\)(( |\t)*#.*)?$|assertIs(Not)?\(None,")
|
||||
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def use_jsonutils(logical_line, filename):
|
||||
"""N521 - jsonutils must be used instead of json.
|
||||
@@ -108,6 +109,7 @@ def _check_namespace_imports(failure_code, namespace, new_ns, logical_line,
|
||||
return (0, msg_o or msg)
|
||||
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def check_no_contextlib_nested(logical_line, filename):
|
||||
"""N524 - Use of contextlib.nested is deprecated.
|
||||
@@ -127,6 +129,7 @@ def check_no_contextlib_nested(logical_line, filename):
|
||||
yield (0, msg)
|
||||
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def no_mutable_default_args(logical_line):
|
||||
"""N529 - Method's default argument shouldn't be mutable.
|
||||
@@ -144,6 +147,7 @@ def no_mutable_default_args(logical_line):
|
||||
# Chances are that most projects will need to put an ignore on this rule
|
||||
# until they can fully migrate to the lib.
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def check_neutron_namespace_imports(logical_line):
|
||||
"""N530 - Direct neutron imports not allowed.
|
||||
@@ -160,6 +164,7 @@ def check_neutron_namespace_imports(logical_line):
|
||||
yield x
|
||||
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def check_no_eventlet_imports(logical_line):
|
||||
"""N535 - Usage of Python eventlet module not allowed.
|
||||
@@ -174,6 +179,7 @@ def check_no_eventlet_imports(logical_line):
|
||||
yield logical_line.index('eventlet'), msg
|
||||
|
||||
|
||||
@core.off_by_default
|
||||
@core.flake8ext
|
||||
def assert_equal_none(logical_line):
|
||||
"""N536 - Use assertIsNone."""
|
||||
|
Reference in New Issue
Block a user