Skip to content

Commit 7acb773

Browse files
committed
add schema generation to pre-commit
1 parent 133f315 commit 7acb773

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ repos:
2323
entry: ruff format --force-exclude
2424
types: [python]
2525
require_serial: true
26+
27+
- id: helm-schema
28+
name: Generate Helm schema
29+
entry: ./generate-schemas.sh
30+
language: system
31+
types: [yaml]
32+
require_serial: true

generate-schemas.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/env bash
22

3-
set -xeuo pipefail
3+
set -euo pipefail
44

55
this_dir=$(dirname "$0")
66
cd "$this_dir"
@@ -10,4 +10,6 @@ helm schema -v || helm plugin install https://github.com/dadav/helm-schema
1010
for chart in Charts/*; do
1111
helm schema -c $chart
1212
ln -fs ../$chart/values.schema.json schemas/$(basename $chart).schema.json
13+
# add a newline to the end of the schema file for pre-commit compliance
14+
echo >> schemas/$(basename $chart).schema.json
1315
done

0 commit comments

Comments
 (0)