diff --git a/pre_commit/clientlib.py b/pre_commit/clientlib.py index 58031e8d..23d662ac 100644 --- a/pre_commit/clientlib.py +++ b/pre_commit/clientlib.py @@ -38,7 +38,7 @@ MANIFEST_HOOK_DICT = schema.Map( schema.Conditional( '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( diff --git a/tests/clientlib_test.py b/tests/clientlib_test.py index deaa7e9e..454824a9 100644 --- a/tests/clientlib_test.py +++ b/tests/clientlib_test.py @@ -187,6 +187,20 @@ def test_validate_manifest_main(args, expected_output): }], 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):