diff options
Diffstat (limited to '')
-rw-r--r-- | pre_commit/commands/validate_manifest.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pre_commit/commands/validate_manifest.py b/pre_commit/commands/validate_manifest.py new file mode 100644 index 0000000..8493c6e --- /dev/null +++ b/pre_commit/commands/validate_manifest.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from collections.abc import Sequence + +from pre_commit import clientlib + + +def validate_manifest(filenames: Sequence[str]) -> int: + ret = 0 + + for filename in filenames: + try: + clientlib.load_manifest(filename) + except clientlib.InvalidManifestError as e: + print(e) + ret = 1 + + return ret |