diff --git a/src/flake8/style_guide.py b/src/flake8/style_guide.py index 284444d..950d722 100644 --- a/src/flake8/style_guide.py +++ b/src/flake8/style_guide.py @@ -63,7 +63,7 @@ class StyleGuide(object): # We do not care about the ``: `` that follows ``noqa`` # We do not care about the casing of ``noqa`` # We want a comma-separated list of errors - '# noqa(?:: )?(?P[A-Z0-9,]+)?$', + '# noqa(?:: (?P[A-Z0-9,]+))?', re.IGNORECASE ) diff --git a/tests/unit/test_style_guide.py b/tests/unit/test_style_guide.py index 3d05528..a38c657 100644 --- a/tests/unit/test_style_guide.py +++ b/tests/unit/test_style_guide.py @@ -127,6 +127,9 @@ def test_should_report_error(select_list, ignore_list, error_code, expected): ('E111', 'a = 1 # noqa: E111,W123,F821', True), ('W123', 'a = 1 # noqa: E111,W123,F821', True), ('E111', 'a = 1 # noqa: E11,W123,F821', True), + ('E111', 'a = 1 # noqa, analysis:ignore', True), + ('E111', 'a = 1 # noqa analysis:ignore', True), + ('E111', 'a = 1 # noqa - We do not care', True), ]) def test_is_inline_ignored(error_code, physical_line, expected_result): """Verify that we detect inline usage of ``# noqa``."""