forked from PyCQA/flake8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PyCQA#1713 from mennoliefstingh/1689-warn-invalid-…
…error-code Adds error when incorrect error codes are parsed from config file
- Loading branch information
Showing
6 changed files
with
84 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters