Skip to content

Commit a52d3c5

Browse files
authored
Merge pull request #339 from nikolaik/nikolaik/vendor-cloudbuild
Add vendoring of cloudbuild schema
2 parents 2feef16 + 5123e35 commit a52d3c5

File tree

8 files changed

+451
-0
lines changed

8 files changed

+451
-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.1
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/builtin_schemas/vendor/cloudbuild.json

Lines changed: 410 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a1586617a33ebdaaec163d224a3a09ff010e5ed9ecccdd7d954715f2ad6e361e

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": {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# empty
2+
{}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
steps:
2+
- name: 'gcr.io/cloud-builders/docker'
3+
entrypoint: "/bin/bash"
4+
args: ['-c', '"echo hello"']

0 commit comments

Comments
 (0)