Need help with clippy-check?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

actions-rs
193 Stars 15 Forks MIT License 43 Commits 35 Opened issues

Description

📎 GitHub Action for PR annotations with clippy warnings

Services available

!
?

Need anything else?

Contributors list

Rust
clippy-check
Action

MIT licensed Gitter

Clippy lints in your Pull Requests

This GitHub Action executes

clippy
and posts all lints as annotations for the pushed commit, as in the live example here.

Screenshot

Example workflow

This example is utilizing

toolchain
Actions to install the most recent

nightly
clippy 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

With stable clippy

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

Inputs

| 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 clippy
command | string | | |
use-cross
| | Use
cross
instead 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
,
args
and
use-cross
inputs, see
cargo
Action
documentation.

NOTE: if your workflow contains multiple instances of the

clippy-check
action you will need to give each invocation a unique name, using the
name
property described above. Check runs must have a unique name, and this prevents a later check run overriding a previous one within the same workflow.

Limitations

Due to token permissions, this Action WILL NOT be able to post

clippy
annotations 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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.