Skip to content

📎 GitHub Action for PR annotations with Rust clippy warnings

License

Notifications You must be signed in to change notification settings

clechasseur/rs-clippy-check

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

rs-clippy-check Action

MIT licensed Continuous integration

Clippy lints in your Pull Requests

This GitHub Action executes clippy and posts all lints as annotations for the pushed commit 1.

Screenshot of a clippy warning displayed in the commit interface of GitHub

This GitHub Action has been forked from actions-rs/clippy-check. The original project published under the name rust-clippy-check. See LICENSE for copyright attribution details.

Example workflow

Note: this workflow uses actions-rust-lang/setup-rust-toolchain to install the most recent nightly clippy.

name: Clippy check

on: push

jobs:
  clippy_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly
          components: clippy
      - uses: clechasseur/rs-clippy-check@v3
        with:
          args: --all-features

Inputs

All inputs are optional.

Name Description Type Default
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
working-directory Directory where to perform the cargo clippy command string

For extra details about the toolchain, args and use-cross inputs, see rs-cargo Action.

Notes

1 : Currently, GitHub sets a limit of 10 annotations of each type per run (see this page for more information). So if there are more than 10 such lints of one type reported by clippy, only the first 10 will appear as PR annotations. The other lints will still appear in the check run summary (see this one for example).

About

📎 GitHub Action for PR annotations with Rust clippy warnings

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript 88.8%
  • Rust 11.2%