mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 06:14:17 +00:00
Adds warning when invalid error codes are parsed for ignore or extend-ignore from config file
This commit is contained in:
parent
5eeee3fbc0
commit
1346ddefd3
6 changed files with 84 additions and 36 deletions
36
tests/unit/test_defaults.py
Normal file
36
tests/unit/test_defaults.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from flake8.defaults import VALID_CODE_PREFIX
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"s",
|
||||
(
|
||||
"E",
|
||||
"E1",
|
||||
"E123",
|
||||
"ABC",
|
||||
"ABC1",
|
||||
"ABC123",
|
||||
),
|
||||
)
|
||||
def test_valid_plugin_prefixes(s):
|
||||
assert VALID_CODE_PREFIX.match(s)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"s",
|
||||
(
|
||||
"",
|
||||
"A1234",
|
||||
"ABCD",
|
||||
"abc",
|
||||
"a-b",
|
||||
"☃",
|
||||
"A𝟗",
|
||||
),
|
||||
)
|
||||
def test_invalid_plugin_prefixes(s):
|
||||
assert VALID_CODE_PREFIX.match(s) is None
|
||||
Loading…
Add table
Add a link
Reference in a new issue