Skip to content

Commit

Permalink
Add annotations in the PR for linter errors
Browse files Browse the repository at this point in the history
This should help contributors notice and fix linter errors when they
occur. Apparently it's as easy as printing a magic string to stdout, who
knew!
  • Loading branch information
ptomato committed Nov 5, 2024
1 parent a773ac6 commit 4e8fc7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/checks-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ jobs:
for file in $CHANGED; do
echo $file
done
./tools/lint/lint.py $CHANGED
./tools/lint/lint.py $CHANGED 2> >(tee errors.out >&2)
- name: Create annotations in the PR
if: failure() && ${{ hashFiles('errors.out') != '' }}
run: |
awk -F': ' <errors.out \
"{ sub(\"$(pwd)/\", \"\"); printf \"::error file=%s,line=1::%s\n\", \$1, \$2 }"

0 comments on commit 4e8fc7f

Please sign in to comment.