Skip to content
📎 GitHub Action for PR annotations with clippy warnings
TypeScript JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github First public version Sep 27, 2019
dist Falling back to the stdout report if token permissions are not allowi… Oct 4, 2019
src Stricter TS config; fix implicit any (#4) Oct 9, 2019
.editorconfig First public version Sep 27, 2019
.gitignore First public version Sep 27, 2019
.npmrc First public version Sep 27, 2019
CHANGELOG.md
LICENSE First public version Sep 27, 2019
README.md Falling back to the stdout report if token permissions are not allowi… Oct 4, 2019
action.yml First public version Sep 27, 2019
jest.config.js First public version Sep 27, 2019
package-lock.json Bump @types/jest from 24.0.18 to 24.0.19 Oct 16, 2019
package.json Bump @types/jest from 24.0.18 to 24.0.19 Oct 16, 2019
tsconfig.json Stricter TS config; fix implicit any (#4) Oct 9, 2019

README.md

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

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

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

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.

You can’t perform that action at this time.