Skip to content

Commit 4e20a2e

Browse files
nikolaiksirosen
authored andcommitted
Add vendoring of cloudbuild schema
1 parent 2feef16 commit 4e20a2e

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@
6868
)$
6969
types_or: [json,yaml]
7070

71+
# this hook is autogenerated from a script
72+
# to modify this hook, update `src/check_jsonschema/catalog.py`
73+
# and run `make generate-hooks` or `tox run -e generate-hooks-config`
74+
- id: check-cloudbuild
75+
name: Validate Google Cloud Build config
76+
description: 'Validate Google Cloud Build config against the schema provided by SchemaStore'
77+
entry: check-jsonschema --builtin-schema vendor.cloudbuild
78+
language: python
79+
files: ^cloudbuild\.(yml|yaml)$
80+
types: [yaml]
81+
7182
# this hook is autogenerated from a script
7283
# to modify this hook, update `src/check_jsonschema/catalog.py`
7384
# and run `make generate-hooks` or `tox run -e generate-hooks-config`

docs/precommit_usage.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ Validate Buildkite Pipelines against the schema provided by Buildkite
9999
- id: check-buildkite
100100
101101
102+
``check-cloudbuild``
103+
~~~~~~~~~~~~~~~~~~~~
104+
105+
Validate Google Cloud Build config against the schema provided by SchemaStore
106+
107+
.. code-block:: yaml
108+
:caption: example config
109+
110+
- repo: https://github.com/python-jsonschema/check-jsonschema
111+
rev: 0.27.0
112+
hooks:
113+
- id: check-cloudbuild
114+
115+
102116
``check-dependabot``
103117
~~~~~~~~~~~~~~~~~~~~
104118

docs/usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ SchemaStore and other sources:
9090
- ``vendor.bamboo-spec``
9191
- ``vendor.bitbucket-pipelines``
9292
- ``vendor.buildkite``
93+
- ``vendor.cloudbuild``
9394
- ``vendor.dependabot``
9495
- ``vendor.drone-ci``
9596
- ``vendor.github-actions``

src/check_jsonschema/catalog.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str:
6868
"types_or": ["json", "yaml"],
6969
},
7070
},
71+
"cloudbuild": {
72+
"url": "https://json.schemastore.org/cloudbuild.json",
73+
"hook_config": {
74+
"name": "Validate Google Cloud Build config",
75+
"files": r"^cloudbuild\.(yml|yaml)$",
76+
"types": "yaml",
77+
},
78+
},
7179
"dependabot": {
7280
"url": "https://json.schemastore.org/dependabot-2.0.json",
7381
"hook_config": {

0 commit comments

Comments
 (0)