mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
add warning for deprecated stages values in default_stages
This commit is contained in:
parent
e7cfc0d2cb
commit
33e020f315
2 changed files with 51 additions and 0 deletions
|
|
@ -335,6 +335,30 @@ def test_no_warning_for_non_deprecated_stages(caplog):
|
|||
assert caplog.record_tuples == []
|
||||
|
||||
|
||||
def test_warning_for_deprecated_default_stages(caplog):
|
||||
cfg = {'default_stages': ['commit', 'push'], 'repos': []}
|
||||
|
||||
cfgv.validate(cfg, CONFIG_SCHEMA)
|
||||
|
||||
assert caplog.record_tuples == [
|
||||
(
|
||||
'pre_commit',
|
||||
logging.WARNING,
|
||||
'top-level `default_stages` uses deprecated stage names '
|
||||
'(commit, push) which will be removed in a future version. '
|
||||
'run: `pre-commit migrate-config` to automatically fix this.',
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def test_no_warning_for_non_deprecated_default_stages(caplog):
|
||||
cfg = {'default_stages': ['pre-commit', 'pre-push'], 'repos': []}
|
||||
|
||||
cfgv.validate(cfg, CONFIG_SCHEMA)
|
||||
|
||||
assert caplog.record_tuples == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'manifest_obj',
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue