summaryrefslogtreecommitdiffstats
path: root/pre_commit/clientlib.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:38 +0000
commit00f5354c65dff6a40cda6b5a2c633f9e92eca1e1 (patch)
treef86bffc17d1b6349d92d3e235560d4850793461f /pre_commit/clientlib.py
parentReleasing debian version 2.18.1-1. (diff)
downloadpre-commit-00f5354c65dff6a40cda6b5a2c633f9e92eca1e1.tar.xz
pre-commit-00f5354c65dff6a40cda6b5a2c633f9e92eca1e1.zip
Merging upstream version 2.19.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/clientlib.py')
-rw-r--r--pre_commit/clientlib.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/pre_commit/clientlib.py b/pre_commit/clientlib.py
index bf4e2e4..9b53e81 100644
--- a/pre_commit/clientlib.py
+++ b/pre_commit/clientlib.py
@@ -14,6 +14,8 @@ from identify.identify import ALL_TAGS
import pre_commit.constants as C
from pre_commit.color import add_color_option
+from pre_commit.commands.validate_config import validate_config
+from pre_commit.commands.validate_manifest import validate_manifest
from pre_commit.errors import FatalError
from pre_commit.languages.all import all_languages
from pre_commit.logging_handler import logging_handler
@@ -100,14 +102,12 @@ def validate_manifest_main(argv: Sequence[str] | None = None) -> int:
args = parser.parse_args(argv)
with logging_handler(args.color):
- ret = 0
- for filename in args.filenames:
- try:
- load_manifest(filename)
- except InvalidManifestError as e:
- print(e)
- ret = 1
- return ret
+ logger.warning(
+ 'pre-commit-validate-manifest is deprecated -- '
+ 'use `pre-commit validate-manifest` instead.',
+ )
+
+ return validate_manifest(args.filenames)
LOCAL = 'local'
@@ -409,11 +409,9 @@ def validate_config_main(argv: Sequence[str] | None = None) -> int:
args = parser.parse_args(argv)
with logging_handler(args.color):
- ret = 0
- for filename in args.filenames:
- try:
- load_config(filename)
- except InvalidConfigError as e:
- print(e)
- ret = 1
- return ret
+ logger.warning(
+ 'pre-commit-validate-config is deprecated -- '
+ 'use `pre-commit validate-config` instead.',
+ )
+
+ return validate_config(args.filenames)