Skip to content

Commit 25be81a

Browse files
authored
Merge pull request #538 from fabolhak/snapcraft
add snapcraft vendor schema and pre-commit hook
2 parents 60b80f9 + ce806fb commit 25be81a

File tree

10 files changed

+1830
-0
lines changed

10 files changed

+1830
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,17 @@
222222
\.renovaterc\.(json|json5)
223223
)$
224224
225+
# this hook is autogenerated from a script
226+
# to modify this hook, update `src/check_jsonschema/catalog.py`
227+
# and run `make generate-hooks` or `tox run -e generate-hooks-config`
228+
- id: check-snapcraft
229+
name: Validate snapcraft files
230+
description: 'Validate snapcraft files against the schema provided by Canonical'
231+
entry: check-jsonschema --builtin-schema vendor.snapcraft
232+
language: python
233+
files: ^(.+/)?snapcraft\.yaml$
234+
types: [yaml]
235+
225236
# this hook is autogenerated from a script
226237
# to modify this hook, update `src/check_jsonschema/catalog.py`
227238
# 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
@@ -267,6 +267,20 @@ Validate Renovate config against the schema provided by Renovate (does not suppo
267267
- id: check-renovate
268268
269269
270+
``check-snapcraft``
271+
~~~~~~~~~~~~~~~~~~~
272+
273+
Validate snapcraft files against the schema provided by Canonical
274+
275+
.. code-block:: yaml
276+
:caption: example config
277+
278+
- repo: https://github.com/python-jsonschema/check-jsonschema
279+
rev: 0.31.3
280+
hooks:
281+
- id: check-snapcraft
282+
283+
270284
``check-taskfile``
271285
~~~~~~~~~~~~~~~~~~
272286

docs/usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ SchemaStore and other sources:
102102
- ``vendor.mergify``
103103
- ``vendor.readthedocs``
104104
- ``vendor.renovate``
105+
- ``vendor.snapcraft``
105106
- ``vendor.taskfile``
106107
- ``vendor.travis``
107108
- ``vendor.woodpecker-ci``

src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.snapcraft

Lines changed: 674 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+
5284c12e66fcc7fdd171fc211d7d7fb47166e114d5ed69993685e288b0078525

0 commit comments

Comments
 (0)