Mach clippy & test-tidy github inline annotation (#37294)

When the --report-ci flag is passed to ./mach clippy or ./mach
test-tidy, the commands emit CI-friendly output to files in the tempy
directory. These files can later be used by [GitHub Workflow
Commands](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-error-message)
for annotations. If the flag is not provided, the default behavior
remains unchanged. Both clippy and test-tidy will limit have 10 limit
annotation

⚠️ Note: For ./mach clippy --report-ci to work correctly, the Clippy
command must use --message-format=json. If it's not specified, CI output
will not be generated, and no warning or error will be shown.

Example PR: https://github.com/jerensl/servo/pull/1/files

Fixes: #37231

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This commit is contained in:
Jerens Lensun 2025-06-22 23:30:19 +08:00 committed by GitHub
parent 18d55f4884
commit 877010c5f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 175 additions and 29 deletions

View file

@ -43,9 +43,8 @@ jobs:
run: |
sudo apt update
./mach bootstrap
# TODO: Do GitHub anotaions
- name: Clippy
run: |
./mach clippy --use-crown --locked -- -- --deny warnings
./mach clippy --use-crown --locked --github-annotations -- -- --deny warnings
- name: Tidy
run: ./mach test-tidy --no-progress --all
run: ./mach test-tidy --no-progress --all --github-annotations