Skip to content

parallelsystems/clippy-check

 
 

Repository files navigation

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/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
            toolchain: nightly
            components: clippy
            override: true
      - uses: actions-rs/clippy-check@v1
        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/checkout@v1
      - run: rustup component add clippy
      - uses: actions-rs/clippy-check@v1
        with:
          args: --all-features

With args-file

name: Clippy check
jobs:
  clippy_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          components: clippy
          override: true
      - uses: gbhand/clippy-check@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args-file: "./clippy_args.txt"

Example file-based args (clippy_args.txt)

# here's a comment
--locked --all-targets --all-features -- 
-D missing_docs
-D unused_extern_crates
-D warnings
# another one
-D clippy::complexity

Inputs

Name Required 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

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

Limitations

The sky

About

📎 GitHub Action for PR annotations with clippy warnings

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.4%
  • TypeScript 29.5%
  • Shell 0.1%