Skip to content

Commit b0b4b8c

Browse files
committed
Update PR linting instructions (PhotonVision#2213)
## Description Removes the checkbox for linting because it's easily invalidated by later pushes. Also prints a link to the linting docs on CI failure. ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] This PR has been [linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html). - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added
1 parent 4f66d33 commit b0b4b8c

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
Merge checklist:
1212
- [ ] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes
1313
- [ ] The description documents the _what_ and _why_
14-
- [ ] This PR has been [linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html).
1514
- [ ] If this PR changes behavior or adds a feature, user documentation is updated
1615
- [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
1716
- [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2

.github/workflows/lint-format.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ jobs:
3535
- name: Run
3636
run: wpiformat
3737
- name: Check output
38-
run: git --no-pager diff --exit-code HEAD
38+
run: |
39+
set +e
40+
git --no-pager diff --exit-code HEAD
41+
exit_code=$?
42+
if test "$exit_code" -ne "0"; then
43+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
44+
exit $exit_code
45+
fi
3946
- name: Generate diff
4047
run: git diff HEAD > wpiformat-fixes.patch
4148
if: ${{ failure() }}
@@ -56,9 +63,15 @@ jobs:
5663
with:
5764
java-version: 17
5865
distribution: temurin
59-
- run: ./gradlew spotlessCheck
66+
- run: |
67+
set +e
68+
./gradlew spotlessCheck
69+
exit_code=$?
70+
if test "$exit_code" -ne "0"; then
71+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
72+
exit $exit_code
73+
fi
6074
name: Run spotless
61-
6275
client-lint-format:
6376
name: "PhotonClient Lint and Formatting"
6477
defaults:
@@ -80,6 +93,20 @@ jobs:
8093
- name: Install Dependencies
8194
run: pnpm i --frozen-lockfile
8295
- name: Check Linting
83-
run: pnpm run lint-ci
96+
run: |
97+
set +e
98+
pnpm run lint-ci
99+
exit_code=$?
100+
if test "$exit_code" -ne "0"; then
101+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
102+
exit $exit_code
103+
fi
84104
- name: Check Formatting
85-
run: pnpm run format-ci
105+
run: |
106+
set +e
107+
pnpm run format-ci
108+
exit_code=$?
109+
if test "$exit_code" -ne "0"; then
110+
echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html"
111+
exit $exit_code
112+
fi

0 commit comments

Comments
 (0)