From b7054f2a6f6fb0c5ac01c738c717360c2fd020c5 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 5 Dec 2025 15:50:05 -0600 Subject: [PATCH] Update PR linting instructions (#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 --- .github/pull_request_template.md | 1 - .github/workflows/lint-format.yml | 37 ++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0d5211e4a..704a41b1a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,7 +11,6 @@ Merge checklist: - [ ] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [ ] 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 diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 9333d9132..ebd69ac83 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -35,7 +35,14 @@ jobs: - name: Run run: wpiformat - name: Check output - run: git --no-pager diff --exit-code HEAD + run: | + set +e + git --no-pager diff --exit-code HEAD + exit_code=$? + if test "$exit_code" -ne "0"; then + echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + exit $exit_code + fi - name: Generate diff run: git diff HEAD > wpiformat-fixes.patch if: ${{ failure() }} @@ -56,9 +63,15 @@ jobs: with: java-version: 17 distribution: temurin - - run: ./gradlew spotlessCheck + - run: | + set +e + ./gradlew spotlessCheck + exit_code=$? + if test "$exit_code" -ne "0"; then + echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + exit $exit_code + fi name: Run spotless - client-lint-format: name: "PhotonClient Lint and Formatting" defaults: @@ -80,6 +93,20 @@ jobs: - name: Install Dependencies run: pnpm i --frozen-lockfile - name: Check Linting - run: pnpm run lint-ci + run: | + set +e + pnpm run lint-ci + exit_code=$? + if test "$exit_code" -ne "0"; then + echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + exit $exit_code + fi - name: Check Formatting - run: pnpm run format-ci + run: | + set +e + pnpm run format-ci + exit_code=$? + if test "$exit_code" -ne "0"; then + echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + exit $exit_code + fi