mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 05:20:20 -06:00
19 lines
362 B
Python
19 lines
362 B
Python
from __future__ import annotations
|
|
|
|
from typing import Sequence
|
|
|
|
from pre_commit import clientlib
|
|
|
|
|
|
def validate_config(filenames: Sequence[str]) -> int:
|
|
ret = 0
|
|
|
|
for filename in filenames:
|
|
try:
|
|
clientlib.load_config(filename)
|
|
except clientlib.InvalidConfigError as e:
|
|
print(e)
|
|
ret = 1
|
|
|
|
return ret
|