forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 2
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 lint for GCT configs
- Loading branch information
Showing
4 changed files
with
2,923 additions
and
2,883 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,23 @@ | ||
name: config-json-lint | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
name: JSON format check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
file: ["config_example.json", "testdata/configtest.json"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install jq | ||
run: sudo apt-get install jq | ||
|
||
- name: Check JSON format for ${{ matrix.file }} | ||
run: | | ||
jq '.exchanges |= sort_by(.name)' --indent 1 ${{ matrix.file }} > processed_${{ matrix.file }} | ||
if ! diff ${{ matrix.file }} processed_${{ matrix.file }}; then | ||
echo "Differences found in ${{ matrix.file }}! Please run 'make lint_configs'" | ||
exit 1 | ||
fi |
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.