Fix H238 to allow parent classes to be returned by a function
There was a corner case that wasn't caught before where you would want to declare a class like this: class Foo(six.with_metaclass(abc.ABCMeta, object)): but this falsely triggered H238. This allows for that and adds one more docstring update for a failure case. Change-Id: Ie7cea4156f0da5bf72d16e5eb5f4e13b7c095d3f
This commit is contained in:
parent
ec6048f135
commit
8990ddbb21
|
@ -205,7 +205,7 @@ def hacking_no_removed_module(logical_line, noqa):
|
|||
"removed in Python 3" % module_name)
|
||||
|
||||
|
||||
RE_NEW_STYLE_CLASS = re.compile(r"^class [^(]+\([^)]+\):")
|
||||
RE_NEW_STYLE_CLASS = re.compile(r"^class [^(]+\(.+\):")
|
||||
|
||||
|
||||
@core.flake8ext
|
||||
|
@ -216,7 +216,9 @@ def hacking_no_old_style_class(logical_line, noqa):
|
|||
Okay: class Foo(object):\n pass
|
||||
Okay: class Foo(Bar, Baz):\n pass
|
||||
Okay: class Foo(object, Baz):\n pass
|
||||
Okay: class Foo(somefunc()):\n pass
|
||||
H238: class Bar:\n pass
|
||||
H238: class Bar():\n pass
|
||||
"""
|
||||
if noqa:
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue