mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix regression in 0.13.5 with always_run + files
This commit is contained in:
parent
e1cdbb3844
commit
ce2f68b40a
2 changed files with 15 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ MANIFEST_HOOK_DICT = schema.Map(
|
||||||
|
|
||||||
schema.Conditional(
|
schema.Conditional(
|
||||||
'files', schema.check_and(schema.check_string, schema.check_regex),
|
'files', schema.check_and(schema.check_string, schema.check_regex),
|
||||||
condition_key='always_run', condition_value=False, ensure_absent=True,
|
condition_key='always_run', condition_value=False,
|
||||||
),
|
),
|
||||||
|
|
||||||
schema.Optional(
|
schema.Optional(
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,20 @@ def test_validate_manifest_main(args, expected_output):
|
||||||
}],
|
}],
|
||||||
True,
|
True,
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
# A regression in 0.13.5: always_run and files are permissible
|
||||||
|
# together (but meaningless). In a future version upgrade this to
|
||||||
|
# an error
|
||||||
|
[{
|
||||||
|
'id': 'a',
|
||||||
|
'name': 'b',
|
||||||
|
'entry': 'c',
|
||||||
|
'language': 'python',
|
||||||
|
'files': '',
|
||||||
|
'always_run': True,
|
||||||
|
}],
|
||||||
|
True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
def test_valid_manifests(manifest_obj, expected):
|
def test_valid_manifests(manifest_obj, expected):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue