-
Notifications
You must be signed in to change notification settings - Fork 820
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qa: Enforce JSON standard for GCT configs (#1526)
* qa: Enforce JSON lint for GCT configs * Makefile/GHA: Make output more verbose on success, clean duplicate PHONY and rid excess newlines * Makefile: Use printf for OS cross-compatibility output
- Loading branch information
Showing
4 changed files
with
2,923 additions
and
2,882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: configs-json-lint | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
name: configs JSON lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check configs JSON format | ||
run: | | ||
files=("config_example.json" "testdata/configtest.json") | ||
for file in "${files[@]}"; do | ||
processed_file="${file%.*}_processed.${file##*.}" | ||
jq '.exchanges |= sort_by(.name)' --indent 1 $file > $processed_file | ||
if ! diff $file $processed_file; then | ||
echo "jq differences found in $file! Please run 'make lint_configs'" | ||
exit 1 | ||
else | ||
rm $processed_file | ||
echo "No differences found in $file 🌞" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.