Skip to content

Commit 5a80940

Browse files
authored
Merge pull request #417 from jrdnbradford/add-taskfile-validation
Add `taskfile` validation hook
2 parents a6aa5a5 + 641d092 commit 5a80940

File tree

7 files changed

+770
-0
lines changed

7 files changed

+770
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,23 @@
164164
\.renovaterc(\.json)?
165165
)$
166166
167+
# this hook is autogenerated from a script
168+
# to modify this hook, update `src/check_jsonschema/catalog.py`
169+
# and run `make generate-hooks` or `tox run -e generate-hooks-config`
170+
- id: check-taskfile
171+
name: Validate Taskfile Config
172+
description: 'Validate Taskfile config against the schema provided by Task'
173+
entry: check-jsonschema --builtin-schema vendor.taskfile
174+
language: python
175+
files: >
176+
(?x)^(
177+
Taskfile\.(yml|yaml)|
178+
taskfile\.(yml|yaml)|
179+
Taskfile\.dist\.(yml|yaml)|
180+
taskfile\.dist\.(yml|yaml)
181+
)$
182+
types: [yaml]
183+
167184
# this hook is autogenerated from a script
168185
# to modify this hook, update `src/check_jsonschema/catalog.py`
169186
# 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
@@ -211,6 +211,20 @@ Validate Renovate config against the schema provided by Renovate (does not suppo
211211
- id: check-renovate
212212
213213
214+
``check-taskfile``
215+
~~~~~~~~~~~~~~~~~~
216+
217+
Validate Taskfile config against the schema provided by Task
218+
219+
.. code-block:: yaml
220+
:caption: example config
221+
222+
- repo: https://github.com/python-jsonschema/check-jsonschema
223+
rev: 0.28.1
224+
hooks:
225+
- id: check-taskfile
226+
227+
214228
``check-travis``
215229
~~~~~~~~~~~~~~~~
216230

docs/usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ SchemaStore and other sources:
9898
- ``vendor.gitlab-ci``
9999
- ``vendor.readthedocs``
100100
- ``vendor.renovate``
101+
- ``vendor.taskfile``
101102
- ``vendor.travis``
102103
- ``vendor.woodpecker-ci``
103104

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Andrey Nering
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)