未验证 提交 ec996ffd 编辑于 作者: Ian Stapleton Cordasco's avatar Ian Stapleton Cordasco
浏览文件

Allow spaces in # noqa lists

To match our new configuration file format and its allowance for spaces
in the list

Closes #356
显示 3 个添加1 个删除
+3 -1
......@@ -46,7 +46,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-Z][0-9]+,?)+))?',
'# noqa(?:: (?P<codes>([A-Z][0-9]+(?:[,\s]+)?)+))?',
re.IGNORECASE
)
......
......@@ -19,6 +19,7 @@ RELATIVE_PATHS = ["flake8", "pep8", "pyflakes", "mccabe"]
("E123,W234,E206,", ["E123", "W234", "E206"]),
("E123,W234,E206, ,\n", ["E123", "W234", "E206"]),
("E123,W234,,E206,,", ["E123", "W234", "E206"]),
("E123, W234,, E206,,", ["E123", "W234", "E206"]),
("E123,,W234,,E206,,", ["E123", "W234", "E206"]),
(["E123", "W234", "E206"], ["E123", "W234", "E206"]),
(["E123", "\n\tW234", "\n E206"], ["E123", "W234", "E206"]),
......
......@@ -11,6 +11,7 @@ from flake8 import style_guide
('E121', 'a = 1 # noqa: E111,W123,F821', False),
('E111', 'a = 1 # noqa: E111,W123,F821', True),
('W123', '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),
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册