diff --git a/src/pep8ext_naming.py b/src/pep8ext_naming.py index 87a6514..97f2c50 100644 --- a/src/pep8ext_naming.py +++ b/src/pep8ext_naming.py @@ -3,7 +3,7 @@ import sys from ast import iter_child_nodes from collections import deque -from fnmatch import fnmatch +from fnmatch import fnmatchcase from functools import partial from itertools import chain @@ -68,7 +68,7 @@ def _err(self, node, code, **kwargs): def _ignored(name, ignore): - return any(fnmatch(name, i) for i in ignore) + return any(fnmatchcase(name, i) for i in ignore) BaseASTCheck = _ASTCheckMeta('BaseASTCheck', (object,), diff --git a/testsuite/N801.py b/testsuite/N801.py index 74046e5..cb9c407 100644 --- a/testsuite/N801.py +++ b/testsuite/N801.py @@ -5,6 +5,9 @@ class notok: class notok: pass #: Okay(--ignore-names=*ok) +class notok: + pass +#: N801:1:7(--ignore-names=*OK) class notok: pass #: N801 diff --git a/testsuite/N802.py b/testsuite/N802.py index cd9028a..d386a3f 100644 --- a/testsuite/N802.py +++ b/testsuite/N802.py @@ -23,6 +23,9 @@ def NotOK(): def NotOK(): pass #: Okay(--ignore-names=*OK) +def NotOK(): + pass +#: N802:1:5(--ignore-names=*ok) def NotOK(): pass #: Okay diff --git a/testsuite/N803.py b/testsuite/N803.py index 1a7a771..741b435 100644 --- a/testsuite/N803.py +++ b/testsuite/N803.py @@ -40,6 +40,9 @@ def b13(BAD, *VERYBAD, **EXTRABAD): #: Okay(--ignore-names=*BAD) def b13(BAD, *VERYBAD, **EXTRABAD): pass +#: N803:1:9(--ignore-names=*bad) +def b13(BAD): + pass #: N803:1:9 def b14(BAD): pass diff --git a/testsuite/N804.py b/testsuite/N804.py index 090c0e8..9612a0c 100644 --- a/testsuite/N804.py +++ b/testsuite/N804.py @@ -17,6 +17,11 @@ def test(self, ads): def __init_subclass(self, ads): pass #: Okay(--ignore-names=klass) +class SpecialConventionCase: + @classmethod + def prepare_meta(klass, root): + pass +#: N804(--ignore-names=KLASS) class SpecialConventionCase: @classmethod def prepare_meta(klass, root): diff --git a/testsuite/N805.py b/testsuite/N805.py index 1fabb4b..e162ac5 100644 --- a/testsuite/N805.py +++ b/testsuite/N805.py @@ -23,6 +23,10 @@ class Foo: def bad(ads, self): pass #: Okay(--ignore-names=source) +class GraphQLNode: + def resolve_foo(source, info): + pass +#: N805(--ignore-names=SOURCE) class GraphQLNode: def resolve_foo(source, info): pass diff --git a/testsuite/N806.py b/testsuite/N806.py index 51969cb..7914933 100644 --- a/testsuite/N806.py +++ b/testsuite/N806.py @@ -29,6 +29,9 @@ def test(): def test(): Bad = 1 #: Okay(--ignore-names=B*) +def test(): + Bad = 1 +#: N806(--ignore-names=b*) def test(): Bad = 1 #: Okay diff --git a/testsuite/N807.py b/testsuite/N807.py index 7e4209d..22e3ba3 100644 --- a/testsuite/N807.py +++ b/testsuite/N807.py @@ -50,6 +50,9 @@ def __bad__(): def __bad__(): pass #: Okay(--ignore-names=__*) +def __bad__(): + pass +#: N807(--ignore-names=__B*) def __bad__(): pass #: Okay diff --git a/testsuite/N815.py b/testsuite/N815.py index 10afd9c..554b973 100644 --- a/testsuite/N815.py +++ b/testsuite/N815.py @@ -25,3 +25,6 @@ class C: #: Okay(--ignore-names=*Case) class C: mixed_Case = 0 +#: N815(--ignore-names=*case) +class C: + mixed_Case = 0 diff --git a/testsuite/N816.py b/testsuite/N816.py index 36f6523..4ff8cec 100644 --- a/testsuite/N816.py +++ b/testsuite/N816.py @@ -22,6 +22,8 @@ mixedCase = 0 #: Okay(--ignore-names=*Case) mixedCase = 0 +#: N816(--ignore-names=*case) +mixedCase = 0 #: Okay Γ = 1 #: N816