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

@ -130,6 +130,7 @@ def test_should_report_error(select_list, ignore_list, error_code, expected):
('E111', 'a = 1 # noqa, analysis:ignore', True),
('E111', 'a = 1 # noqa analysis:ignore', True),
('E111', 'a = 1 # noqa - We do not care', 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``."""