Skip to content

Commit 8a0f38d

Browse files
authored
ci(linter): show which step failed (#1013)
Before: <img width="1006" height="1294" alt="image" src="https://github.com/user-attachments/assets/f855d9d0-b58f-4cd6-98de-a00d8698b93b" /> After: <img width="2054" height="1318" alt="image" src="https://github.com/user-attachments/assets/c7bb2bc4-ce35-4580-97fc-61e3578b193f" />
1 parent 7d197db commit 8a0f38d

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/linter.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,22 @@ jobs:
6262

6363
- name: Check Linter Statuses
6464
if: always() # This ensures the step runs even if previous steps failed
65+
env:
66+
RUFF_LINT: ${{ steps.ruff-lint.outcome }}
67+
RUFF_FORMAT: ${{ steps.ruff-format.outcome }}
68+
MYPY: ${{ steps.mypy.outcome }}
69+
PYRIGHT: ${{ steps.pyright.outcome }}
70+
JSCPD: ${{ steps.jscpd.outcome }}
6571
run: |
66-
if [[ "${{ steps.ruff-lint.outcome }}" == "failure" || \
67-
"${{ steps.ruff-format.outcome }}" == "failure" || \
68-
"${{ steps.mypy.outcome }}" == "failure" || \
69-
"${{ steps.pyright.outcome }}" == "failure" || \
70-
"${{ steps.jscpd.outcome }}" == "failure" ]]; then
71-
echo "One or more linting/checking steps failed."
72+
failed=()
73+
[[ "$RUFF_LINT" == "failure" ]] && failed+=("Ruff Linter")
74+
[[ "$RUFF_FORMAT" == "failure" ]] && failed+=("Ruff Formatter")
75+
[[ "$MYPY" == "failure" ]] && failed+=("MyPy")
76+
[[ "$PYRIGHT" == "failure" ]] && failed+=("Pyright")
77+
[[ "$JSCPD" == "failure" ]] && failed+=("JSCPD")
78+
79+
if (( ${#failed[@]} )); then
80+
joined=$(IFS=', '; echo "${failed[*]}")
81+
echo "::error title=Linter failures::The following checks failed: ${joined}. See the corresponding step logs above for details."
7282
exit 1
7383
fi

0 commit comments

Comments
 (0)