diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7bb450616..306f5f805 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -76,8 +76,8 @@ description: 'Validate Google Cloud Build config against the schema provided by SchemaStore' entry: check-jsonschema --builtin-schema vendor.cloudbuild language: python - files: ^cloudbuild\.(yml|yaml)$ - types: [yaml] + files: ^cloudbuild\.(yml|yaml|json)$ + types_or: [json,yaml] # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index 24d408da4..4fea96c86 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -74,8 +74,12 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "url": "https://json.schemastore.org/cloudbuild.json", "hook_config": { "name": "Validate Google Cloud Build config", - "files": r"^cloudbuild\.(yml|yaml)$", - "types": "yaml", + "description": ( + "Validate Google Cloud Build config against the schema provided " + "by SchemaStore" + ), + "files": r"^cloudbuild\.(yml|yaml|json)$", + "types_or": ["json", "yaml"], }, }, "dependabot": {