summaryrefslogtreecommitdiff
path: root/src/flake8/defaults.py
diff options
context:
space:
mode:
authorMarkus Piotrowski <markus.piotrowski@ruhr-uni-bochum.de>2019-06-16 15:55:37 +0000
committerMarkus Piotrowski <markus.piotrowski@ruhr-uni-bochum.de>2019-06-16 15:55:37 +0000
commit0ac337608b3d88079aa91bdcffed7b4df6fd28a8 (patch)
treeec416acdc2a614fdf680086c9e2eddbe21df420c /src/flake8/defaults.py
parent2f8bc64b1e688cc835e57547c544f34b8bcd7a2a (diff)
downloadflake8-0ac337608b3d88079aa91bdcffed7b4df6fd28a8.tar.gz
This PR addresses issue #549 (noqa does only work as intended with single letter error codes). A single change in the regex `NOQA_INLINE_REGEXP` in `defaults.py` will allow to catch error codes which consist of more than one letter.
This will close #549.
Diffstat (limited to 'src/flake8/defaults.py')
-rw-r--r--src/flake8/defaults.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flake8/defaults.py b/src/flake8/defaults.py
index 3fff376..72452a7 100644
--- a/src/flake8/defaults.py
+++ b/src/flake8/defaults.py
@@ -36,7 +36,7 @@ NOQA_INLINE_REGEXP = re.compile(
# We do not care about the casing of ``noqa``
# We want a comma-separated list of errors
# https://regex101.com/r/4XUuax/2 full explenation of the regex
- r"# noqa(?::[\s]?(?P<codes>([A-Z][0-9]+(?:[,\s]+)?)+))?",
+ r"# noqa(?::[\s]?(?P<codes>([A-Z]+[0-9]+(?:[,\s]+)?)+))?",
re.IGNORECASE,
)