Skip to content

Commit 826e0f8

Browse files
committed
make print more obvious
1 parent 9c193c3 commit 826e0f8

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

.github/workflows/lint-format.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ jobs:
3535
- name: Run
3636
run: wpiformat
3737
- name: Check output
38-
run: git --no-pager diff --exit-code HEAD
39-
- name: Print linting docs link
40-
if: ${{ failure()}}
41-
run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
38+
run: |
39+
git --no-pager diff --exit-code HEAD
40+
exit_code=$?
41+
if test "$exit_code" -ne "0"; then
42+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
43+
exit $exit_code
44+
fi
4245
- name: Generate diff
4346
run: git diff HEAD > wpiformat-fixes.patch
4447
if: ${{ failure() }}
@@ -59,12 +62,14 @@ jobs:
5962
with:
6063
java-version: 17
6164
distribution: temurin
62-
- run: ./gradlew spotlessCheck
65+
- run: |
66+
./gradlew spotlessCheck
67+
exit_code=$?
68+
if test "$exit_code" -ne "0"; then
69+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
70+
exit $exit_code
71+
fi
6372
name: Run spotless
64-
- name: Print linting docs link
65-
if: ${{ failure() }}
66-
run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
67-
6873
client-lint-format:
6974
name: "PhotonClient Lint and Formatting"
7075
defaults:
@@ -86,9 +91,18 @@ jobs:
8691
- name: Install Dependencies
8792
run: pnpm i --frozen-lockfile
8893
- name: Check Linting
89-
run: pnpm run lint-ci
94+
run: |
95+
pnpm run lint-ci
96+
exit_code=$?
97+
if test "$exit_code" -ne "0"; then
98+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
99+
exit $exit_code
100+
fi
90101
- name: Check Formatting
91-
run: pnpm run format-ci
92-
- name: Print linting docs link
93-
if: ${{ failure() }}
94-
run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
102+
run: |
103+
pnpm run format-ci
104+
exit_code=$?
105+
if test "$exit_code" -ne "0"; then
106+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
107+
exit $exit_code
108+
fi

0 commit comments

Comments
 (0)