Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

rust-clippy-check

Actions
Run clippy and annotate the diff with errors and warnings
v1.0.2
Star (292)

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 components-nightly and 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
      - id: component
        uses: actions-rs/components-nightly@v1
        with:
          component: clippy
      - uses: actions-rs/toolchain@v1
        with:
            toolchain: ${{ steps.component.outputs.toolchain }}
            override: true
      - run: rustup component add clippy
      - 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:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

Inputs

  • token (required): GitHub secret token
  • toolchain - Rust toolchain to use (without the + sign, ex. nightly);
    Override or system default toolchain will be used if omitted.
  • args - Arguments for the cargo clippy command
  • use-cross - Use cross instead of cargo (default: false)

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

rust-clippy-check is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run clippy and annotate the diff with errors and warnings
v1.0.2

rust-clippy-check is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.