Add jsonnetfmt targets

This should make it a little bit easier for people wanting to check if
their files are formated correctly. Has the added bonus of making the CI
check simpler as well.

Signed-off-by: Tristan Partin <tristan@neon.tech>
This commit is contained in:
Tristan Partin
2024-10-15 20:01:13 -05:00
committed by GitHub
parent be5d6a69dc
commit 061ea0de7a
2 changed files with 9 additions and 2 deletions

View File

@@ -136,8 +136,7 @@ jobs:
- name: Check Jsonnet code formatting
run: |
jsonnetfmt --test \
$(find . -type f -name '*.jsonnet' -o -name '*.libsonnet')
make -C compute jsonnetfmt-test
# Check that the vendor/postgres-* submodules point to the
# corresponding REL_*_STABLE_neon branches.

View File

@@ -35,3 +35,11 @@ clean:
etc/neon_collector_autoscaling.yml \
etc/sql_exporter.yml \
etc/sql_exporter_autoscaling.yml
.PHONY: jsonnetfmt-test
jsonnetfmt-test:
jsonnetfmt --test $(jsonnet_files)
.PHONY: jsonnetfmt-format
jsonnetfmt-format:
jsonnetfmt --in-place $(jsonnet_files)