📎 GitHub Action for PR annotations with clippy warnings
clippy-checkAction
Clippy lints in your Pull Requests
clippyand posts all lints as annotations for the pushed commit, as in the live example here.
toolchainActions to install the most recent
nightlyclippy version.
on: push name: Clippy check jobs: clippy_check: runs-on: ubuntu-latest steps: - uses: actions/[email protected] - uses: actions-rs/[email protected] with: toolchain: nightly components: clippy override: true - uses: actions-rs/[email protected] with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features
on: push name: Clippy check jobs: clippy_check: runs-on: ubuntu-latest steps: - uses: actions/[email protected] - run: rustup component add clippy - uses: actions-rs/[email protected] with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features
| Name | Required | Description | Type | Default | | ------------| :------: | ---------------------------------------------------------------------------------------------------------------------------------------| ------ | --------| |
token| âś“ | GitHub secret token, usually a
${{ secrets.GITHUB_TOKEN }}| string | | |
toolchain| | Rust toolchain to use; override or system default toolchain will be used if omitted | string | | |
args| | Arguments for the
cargo clippycommand | string | | |
use-cross| | Use
crossinstead of
cargo| bool | false | |
name| | Name of the created GitHub check. If running this action multiple times, each run must have a unique name. | string | clippy |
For extra details about the
toolchain,
argsand
use-crossinputs, see
cargoAction documentation.
NOTE: if your workflow contains multiple instances of the
clippy-checkaction you will need to give each invocation a unique name, using the
nameproperty described above. Check runs must have a unique name, and this prevents a later check run overriding a previous one within the same workflow.
Due to token permissions, this Action WILL NOT be able to post
clippyannotations for Pull Requests from the forked repositories.
This is a pretty big problem, which can be solved only by Github themselves, see #2 for details.\ As a fallback this Action will output all clippy messages into the stdout and fail the result correspondingly.