summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/validate_manifest.py
blob: 8493c6e1e666eaeea62abfbf4e23955d56e43aa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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