Skip to content

Commit c2edda0

Browse files
committed
add snapcraft vendor schema and pre-commit hook
1 parent f7d9d71 commit c2edda0

File tree

10 files changed

+1830
-0
lines changed

10 files changed

+1830
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@
206206
\.renovaterc\.(json|json5)
207207
)$
208208
209+
# this hook is autogenerated from a script
210+
# to modify this hook, update `src/check_jsonschema/catalog.py`
211+
# and run `make generate-hooks` or `tox run -e generate-hooks-config`
212+
- id: check-snapcraft
213+
name: Validate snapcraft files
214+
description: 'Validate snapcraft files against the schema provided by SchemaStore'
215+
entry: check-jsonschema --builtin-schema vendor.snapcraft
216+
language: python
217+
files: >
218+
(?x)^(
219+
([^/]*/)*snapcraft.yaml
220+
)$
221+
types: [yaml]
222+
209223
# this hook is autogenerated from a script
210224
# to modify this hook, update `src/check_jsonschema/catalog.py`
211225
# 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
@@ -253,6 +253,20 @@ Validate Renovate config against the schema provided by Renovate (does not suppo
253253
- id: check-renovate
254254
255255
256+
``check-snapcraft``
257+
~~~~~~~~~~~~~~~~~~~
258+
259+
Validate snapcraft files against the schema provided by SchemaStore
260+
261+
.. code-block:: yaml
262+
:caption: example config
263+
264+
- repo: https://github.com/python-jsonschema/check-jsonschema
265+
rev: 0.31.3
266+
hooks:
267+
- id: check-snapcraft
268+
269+
256270
``check-taskfile``
257271
~~~~~~~~~~~~~~~~~~
258272

docs/usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ SchemaStore and other sources:
101101
- ``vendor.mergify``
102102
- ``vendor.readthedocs``
103103
- ``vendor.renovate``
104+
- ``vendor.snapcraft``
104105
- ``vendor.taskfile``
105106
- ``vendor.travis``
106107
- ``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)