Match noqa for users with explanations

This makes the regular expression a bit more complex, and potentially
slower, but it will fix the issue where users had noqa comments with
colons followed by explanations.

Closes #178
This commit is contained in:
Ian Cordasco 2016-07-28 06:25:41 -05:00
parent 47e3e65cc1
commit c0ddc54f2f
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
4 changed files with 13 additions and 1 deletions

View file

@ -27,7 +27,7 @@ NOQA_INLINE_REGEXP = re.compile(
# 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<codes>[A-Z0-9,]+))?',
'# noqa(?:: (?P<codes>([A-Z][0-9]+,?)+))?',
re.IGNORECASE
)