summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/validate_manifest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:25 +0000
commita5907b904f568d3249b7629ea9ff3b932f723ce3 (patch)
treeb82c427c125ea5fcf9d1e2fb48e4a529fc932fba /pre_commit/commands/validate_manifest.py
parentAdding upstream version 2.18.1. (diff)
downloadpre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.tar.xz
pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.zip
Adding upstream version 2.19.0.upstream/2.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands/validate_manifest.py')
-rw-r--r--pre_commit/commands/validate_manifest.py16
1 files changed, 16 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..372a638
--- /dev/null
+++ b/pre_commit/commands/validate_manifest.py
@@ -0,0 +1,16 @@
+from __future__ import annotations
+
+from pre_commit import clientlib
+
+
+def validate_manifest(filenames: list[str]) -> int:
+ ret = 0
+
+ for filename in filenames:
+ try:
+ clientlib.load_manifest(filename)
+ except clientlib.InvalidManifestError as e:
+ print(e)
+ ret = 1
+
+ return ret