mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Deprecate the pcre language
This commit is contained in:
parent
65f60e2593
commit
d5dcebf671
2 changed files with 40 additions and 2 deletions
|
|
@ -529,7 +529,7 @@ def test_push_hook(cap_out, repo_with_passing_hook, mock_out_store_directory):
|
|||
('id', 'do_not_commit'),
|
||||
('name', 'hook 2'),
|
||||
('entry', 'DO NOT COMMIT'),
|
||||
('language', 'pcre'),
|
||||
('language', 'pygrep'),
|
||||
('types', ['text']),
|
||||
('stages', ['push']),
|
||||
)),
|
||||
|
|
@ -592,7 +592,7 @@ def test_local_hook_passes(
|
|||
('id', 'do_not_commit'),
|
||||
('name', 'Block if "DO NOT COMMIT" is found'),
|
||||
('entry', 'DO NOT COMMIT'),
|
||||
('language', 'pcre'),
|
||||
('language', 'pygrep'),
|
||||
('files', '^(.*)$'),
|
||||
)),
|
||||
),
|
||||
|
|
@ -645,6 +645,35 @@ def test_local_hook_fails(
|
|||
)
|
||||
|
||||
|
||||
def test_pcre_deprecation_warning(
|
||||
cap_out, repo_with_passing_hook, mock_out_store_directory,
|
||||
):
|
||||
config = OrderedDict((
|
||||
('repo', 'local'),
|
||||
(
|
||||
'hooks', [OrderedDict((
|
||||
('id', 'pcre-hook'),
|
||||
('name', 'pcre-hook'),
|
||||
('language', 'pcre'),
|
||||
('entry', '.'),
|
||||
))],
|
||||
),
|
||||
))
|
||||
add_config_to_repo(repo_with_passing_hook, config)
|
||||
|
||||
_test_run(
|
||||
cap_out,
|
||||
repo_with_passing_hook,
|
||||
opts={},
|
||||
expected_outputs=[
|
||||
b'[WARNING] `pcre-hook` (from local) uses the deprecated '
|
||||
b'pcre language.',
|
||||
],
|
||||
expected_ret=0,
|
||||
stage=False,
|
||||
)
|
||||
|
||||
|
||||
def test_meta_hook_passes(
|
||||
cap_out, repo_with_passing_hook, mock_out_store_directory,
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue