Skip to content

Commit 9a343b3

Browse files
committed
ci: add script to generate hatch matrix
1 parent 8460530 commit 9a343b3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -u
2+
outfile=$1
3+
hatch env show --json | jq 'to_entries | map(select(.key | startswith("test")))' | jq '{include: map({"hatch-env-name": .key, "python-version": .value.python})}' > $outfile

.pre-commit-config.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ repos:
3333
- id: conventional-pre-commit
3434
stages: [commit-msg]
3535

36+
- repo: local
37+
hooks:
38+
- id: generate-hatch-matrix
39+
name: generate-hatch-matrix
40+
language: script
41+
entry: .github/workflows/generate-hatch-matrix.sh
42+
files: |
43+
(?x)^(
44+
.github/workflows/generate-hatch-matrix.sh|
45+
.github/workflows/hatch-matrix.json
46+
)$
47+
args: [".github/workflows/hatch-matrix.json"]
48+
pass_filenames: false
49+
types: [bash]
50+
3651
ci:
3752
# autofix_commit_msg: |
3853
# [pre-commit.ci] auto fixes from pre-commit.com hooks

0 commit comments

Comments
 (0)