mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
5a0366bcb0
commit
3ad7c548b7
2 changed files with 37 additions and 38 deletions
|
|
@ -240,63 +240,62 @@ def test_validate_optional_sensible_regex_at_hook(caplog, regex, warning):
|
|||
assert caplog.record_tuples == [('pre_commit', logging.WARNING, warning)]
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('regex', 'warning'),
|
||||
(
|
||||
(
|
||||
"(?x)^(\n^some-dir/some-sub-dir|\n)/",
|
||||
'(?x)^(\n^some-dir/some-sub-dir|\n)/',
|
||||
"Potentially dangerous trailing pipe pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"^some/path1|",
|
||||
'^some/path1|',
|
||||
"Potentially dangerous trailing pipe pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(\n" "^some/path1|\n" "^some/path2|\n" ")",
|
||||
'(?x)^(\n' '^some/path1|\n' '^some/path2|\n' ')',
|
||||
"Potentially dangerous trailing pipe pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"^some/path2/",
|
||||
'^some/path2/',
|
||||
"Potentially dangerous trailing slash pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(^some-dir/)/",
|
||||
'(?x)^(^some-dir/)/',
|
||||
"Potentially dangerous trailing slash pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(\n^some-dir|)/",
|
||||
'(?x)^(\n^some-dir|)/',
|
||||
"Potentially dangerous trailing pipe pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(\n^some-dir/\n)/",
|
||||
'(?x)^(\n^some-dir/\n)/',
|
||||
"Potentially dangerous trailing slash pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(\n^some-dir/\n\t\t\t\t)/",
|
||||
'(?x)^(\n^some-dir/\n\t\t\t\t)/',
|
||||
"Potentially dangerous trailing slash pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
(
|
||||
"(?x)^(\n^some-dir/\n )/",
|
||||
'(?x)^(\n^some-dir/\n )/',
|
||||
"Potentially dangerous trailing slash pattern detected in 'files' field of the hook: 'flake8'"
|
||||
"This can uninteded behaviour such as the files option being rendered empty"
|
||||
"It is recommended to remove the trailing character prompted"
|
||||
'This can uninteded behaviour such as the files option being rendered empty'
|
||||
'It is recommended to remove the trailing character prompted',
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue