This action runs Clippy with reviewdog on pull requests to improve code review experience.
name: clippy-action
on: [pull_request]
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}Optional. Default is ${{ github.token }}.
Optional. clippy flags. (cargo clippy --color never -q --message-format json <clippy_flags>)
For example, clippy_flags: -- -Dwarnings.
Optional. Tool name to use for reviewdog reporter. Useful when running multiple actions with different config.
Optional. Report level for reviewdog [info,warning,error].
It's same as -level flag of reviewdog.
Optional. Working directory relative to the root directory.
Optional. Reporter of reviewdog command [github-pr-check,github-pr-review].
It's same as -reporter flag of reviewdog.
cargo clippy |
cargo clippy -- -Dwarnings |
|---|---|
cargo clippy |
cargo clippy -- -Dwarnings |
|---|---|
Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is added.
Optional. Exit code for reviewdog when errors are found [true, false]
Default is false.
Optional. Additional reviewdog flags
Optional. Install a specific version of reviewdog. By default, the latest version of reviewdog is installed.