mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
fix: Add missing warning for regular expression with [\\/]
test: Test case parameters for said regular expression refactor: For-loop for regex warnings instead of multiple if statements resolves #2151
This commit is contained in:
parent
a737d5fe2f
commit
d4ffa5befb
2 changed files with 24 additions and 24 deletions
|
|
@ -265,6 +265,11 @@ def test_warn_mutable_rev_conditional():
|
|||
r"pre-commit normalizes slashes in the 'files' field in hook "
|
||||
r"'flake8' to forward slashes, so you can use / instead of [/\\]",
|
||||
),
|
||||
(
|
||||
r'dir[\\/].*\.py',
|
||||
r"pre-commit normalizes slashes in the 'files' field in hook "
|
||||
r"'flake8' to forward slashes, so you can use / instead of [\\/]",
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_validate_optional_sensible_regex_at_hook(caplog, regex, warning):
|
||||
|
|
@ -295,6 +300,11 @@ def test_validate_optional_sensible_regex_at_hook(caplog, regex, warning):
|
|||
r"pre-commit normalizes the slashes in the top-level 'files' "
|
||||
r'field to forward slashes, so you can use / instead of [/\\]',
|
||||
),
|
||||
(
|
||||
r'dir[\\/].*\.py',
|
||||
r"pre-commit normalizes the slashes in the top-level 'files' "
|
||||
r'field to forward slashes, so you can use / instead of [\\/]',
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_validate_optional_sensible_regex_at_top_level(caplog, regex, warning):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue