Skip to content

Commit e1c792f

Browse files
committed
format ubuntu only
1 parent 9293c6b commit e1c792f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/pr.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151

5252
- run: yarn --frozen-lockfile
5353

54+
- run: yarn format:check
55+
if: ${{ matrix.os == 'ubuntu-latest' }}
56+
5457
- run: yarn build
5558

5659
- run: yarn checkchange --verbose
@@ -115,6 +118,7 @@ jobs:
115118
- name: Format
116119
run: cargo fmt --check
117120
working-directory: ./rust
121+
if: ${{ matrix.os == 'ubuntu-latest' }}
118122

119123
- name: Lint
120124
run: cargo clippy --all-targets -- -D warnings
@@ -148,9 +152,15 @@ jobs:
148152
cache-dependency-path: go/go.sum
149153

150154
- name: Format
151-
run: test -z "$(gofmt -l .)"
152-
shell: bash
155+
run: |
156+
unformatted=$(gofmt -l .)
157+
if [ -n "$unformatted" ]; then
158+
echo "The following files need formatting (run 'gofmt -w .'):"
159+
echo "$unformatted"
160+
exit 1
161+
fi
153162
working-directory: ./go
163+
if: ${{ matrix.os == 'ubuntu-latest' }}
154164

155165
- name: Lint
156166
run: go vet ./...

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.nojekyll
99
.nvmrc
1010
docs/.vuepress/dist/
11+
**/.yarn
1112
/change/
1213
/CHANGELOG.*
1314
/lib/

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"checkchange": "node ./lib/cli.js check",
2929
"docs": "echo \"Run this from the docs folder instead\" && exit 1",
3030
"docs:build": "echo \"Run this from the docs folder instead\" && exit 1",
31-
"format": "prettier --write '**/*'",
31+
"format": "prettier --write .",
32+
"format:check": "prettier --check .",
3233
"prepare": "husky install",
3334
"lint": "yarn lint:deps && yarn lint:code",
3435
"lint:code": "eslint --color --max-warnings=0 src",

0 commit comments

Comments
 (0)