From 3399c36aeea24e8c252eaec781509ec41db8fd80 Mon Sep 17 00:00:00 2001 From: samfreund Date: Mon, 1 Dec 2025 09:32:03 -0600 Subject: [PATCH 1/3] print lint docs link on CI failure --- .github/pull_request_template.md | 1 - .github/workflows/lint-format.yml | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0d5211e4a4..704a41b1ac 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 9333d91327..0c59268187 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -36,6 +36,9 @@ jobs: run: wpiformat - name: Check output run: git --no-pager diff --exit-code HEAD + - name: Print linting docs link + if: ${{ failure()}} + run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" - name: Generate diff run: git diff HEAD > wpiformat-fixes.patch if: ${{ failure() }} @@ -58,6 +61,9 @@ jobs: distribution: temurin - run: ./gradlew spotlessCheck name: Run spotless + - name: Print linting docs link + if: ${{ failure() }} + run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" client-lint-format: name: "PhotonClient Lint and Formatting" @@ -83,3 +89,6 @@ jobs: run: pnpm run lint-ci - name: Check Formatting run: pnpm run format-ci + - name: Print linting docs link + if: ${{ failure() }} + run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" From 03305a4a8e12a8a563da97448be244963f890612 Mon Sep 17 00:00:00 2001 From: samfreund Date: Mon, 1 Dec 2025 13:09:10 -0600 Subject: [PATCH 2/3] add error text --- .github/workflows/lint-format.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 0c59268187..94d00bb713 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -38,7 +38,7 @@ jobs: run: git --no-pager diff --exit-code HEAD - name: Print linting docs link if: ${{ failure()}} - run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" - name: Generate diff run: git diff HEAD > wpiformat-fixes.patch if: ${{ failure() }} @@ -63,7 +63,7 @@ jobs: name: Run spotless - name: Print linting docs link if: ${{ failure() }} - run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" client-lint-format: name: "PhotonClient Lint and Formatting" @@ -91,4 +91,4 @@ jobs: run: pnpm run format-ci - name: Print linting docs link if: ${{ failure() }} - run: echo "Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" From 61f92fb967f49f0e9338d9242679425fb44ae0d5 Mon Sep 17 00:00:00 2001 From: samfreund Date: Wed, 3 Dec 2025 13:35:58 -0600 Subject: [PATCH 3/3] make print more obvious --- .github/workflows/lint-format.yml | 46 +++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 94d00bb713..ebd69ac83b 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -35,10 +35,14 @@ jobs: - name: Run run: wpiformat - name: Check output - run: git --no-pager diff --exit-code HEAD - - name: Print linting docs link - if: ${{ failure()}} - run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + 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() }} @@ -59,12 +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 - - name: Print linting docs link - if: ${{ failure() }} - run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" - client-lint-format: name: "PhotonClient Lint and Formatting" defaults: @@ -86,9 +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 - - name: Print linting docs link - if: ${{ failure() }} - run: echo "::error ::Linting failed. See https://docs.photonvision.org/en/latest/docs/contributing/linting.html" + 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