Skip to content

Commit f84e129

Browse files
petertsengiHiD
authored andcommitted
add format-array to CI
pull request: #1968
1 parent 2d74539 commit f84e129

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/action-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
run: yarn install --pure-lockfile
8484

8585
- name: Format JSON files
86-
run: yarn format-json
86+
run: yarn format-json && ruby bin/format-array.rb
8787

8888
- name: 'Commit formatted code'
8989
run: |

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,10 @@ jobs:
153153
run: yarn install
154154

155155
- name: Verify that json files are formatted correctly
156-
run: yarn test-json-formatting
156+
run: |
157+
yarn format-json && ruby bin/format-array.rb
158+
if ! git diff --quiet --exit-code; then
159+
echo "please format the files with prettier and bin/format-array.rb, or apply the following changes:"
160+
git diff
161+
exit 1
162+
fi

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"scripts": {
1414
"test": "ajv -s canonical-data.schema.json -d \"exercises/*/canonical-data.json\"",
1515
"test-one": "ajv -s canonical-data.schema.json -d",
16-
"test-json-formatting": "prettier --check **/*.json",
1716
"format-json": "prettier --write **/*.json"
1817
},
1918
"resolutions": {

0 commit comments

Comments
 (0)