summaryrefslogtreecommitdiffstats
path: root/pre_commit/clientlib.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/clientlib.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/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)