File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 55 language : script
66 always_run : true
77 args : [upstream_url]
8+
89- id : validate-config
10+ name : Validate package config
11+ description : Check for missing values and incorrect types
12+ entry : ./pre-commit-hooks/validate-config.sh
13+ language : script
14+ files : ^\.?packit.ya?ml$
15+
16+ - id : validate-config-in-container
917 name : Validate package config
1018 description : Check for missing values and incorrect types
1119 entry : quay.io/packit/packit:latest packit -d validate-config
Original file line number Diff line number Diff line change @@ -3,16 +3,38 @@ Our repo for managing pre-commit hooks
33
44### Our hooks
55
6- - ` check-rebase ` - Check if your branch is up to date with the upstream.
6+ - ` check-rebase ` - Check if your branch is up-to- date with the upstream.
77 - Specify the url of the upstream repo in ` args: [git://github...] ` .
8-
8+ - ` validate-config ` - Validate a [ package config for Packit] ( https://packit.dev/docs/configuration ) .
9+ - Requires ` bash ` .
10+ - Runs the validation if there's a ` packit ` binary present.
11+ - Passes if ` packit ` is not installed; this is useful if you can't install ` packit ` in the CI but still want to run the hook at least locally.
12+ - ` validate-config-in-container ` - Validate a [ package config for Packit] ( https://packit.dev/docs/configuration ) .
13+ - Uses [ packit image] ( https://quay.io/repository/packit/packit ) to run packit in a container.
14+ - Requires ` docker ` binary to be present, which can be a problem for example in [ pre-commit.ci] ( https://github.com/pre-commit-ci/issues/issues/11 )
915
1016### Using check-rebase with pre-commit
1117
1218Add this to your ` .pre-commit-config.yaml `
1319
1420 - repo: https://github.com/packit/pre-commit-hooks
15- rev: the revision or tag to clone at
21+ rev: v1.2.0
1622 hooks:
17- - id: check-rebase
23+ - id: check-rebase
1824 args: [upstream_url]
25+
26+ ### Using validate-config with pre-commit
27+
28+ Add this to your ` .pre-commit-config.yaml `
29+
30+ - repo: https://github.com/packit/pre-commit-hooks
31+ rev: v1.2.0
32+ hooks:
33+ - id: validate-config
34+
35+ or
36+
37+ - repo: https://github.com/packit/pre-commit-hooks
38+ rev: v1.2.0
39+ hooks:
40+ - id: validate-config-in-container
Original file line number Diff line number Diff line change 1+ #! /usr/bin/bash
2+
3+ set -eu
4+
5+ if command -v packit; then
6+ packit -d validate-config
7+ else
8+ echo " packit not installed, can't validate the config"
9+ echo " either install packit or try the validate-config-in-container hook"
10+ fi
You can’t perform that action at this time.
0 commit comments