mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Merge branch 'allow_multiple_letters_in_codes' into 'master'
FIX 507: allow multiple letters in codes See merge request pycqa/flake8!303
This commit is contained in:
commit
dc7b082b96
2 changed files with 6 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ _Token = collections.namedtuple("Token", ("tp", "src"))
|
|||
_CODE, _FILE, _COLON, _COMMA, _WS = "code", "file", "colon", "comma", "ws"
|
||||
_EOF = "eof"
|
||||
_FILE_LIST_TOKEN_TYPES = [
|
||||
(re.compile(r"[A-Z][0-9]*(?=$|\s|,)"), _CODE),
|
||||
(re.compile(r"[A-Z]+[0-9]*(?=$|\s|,)"), _CODE),
|
||||
(re.compile(r"[^\s:,]+"), _FILE),
|
||||
(re.compile(r"\s*:\s*"), _COLON),
|
||||
(re.compile(r"\s*,\s*"), _COMMA),
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ def test_parse_comma_separated_list(value, expected):
|
|||
['f.py:E,F', 'g.py:G,H'],
|
||||
[('f.py', ['E', 'F']), ('g.py', ['G', 'H'])],
|
||||
),
|
||||
# six-digits codes are allowed
|
||||
(
|
||||
'f.py: ABC123',
|
||||
[('f.py', ['ABC123'])],
|
||||
)
|
||||
),
|
||||
)
|
||||
def test_parse_files_to_codes_mapping(value, expected):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue