actions-rs/clippy-check

📎 GitHub Action for PR annotations with clippy warnings

TypeScript

292

43 commits

updated Jan 10, 2023

See the code

README

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:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

Inputs

NameRequiredDescriptionTypeDefault
tokenGitHub secret token, usually a ${{ secrets.GITHUB_TOKEN }}string
toolchainRust toolchain to use; override or system default toolchain will be used if omittedstring
argsArguments for the cargo clippy commandstring
use-crossUse cross instead of cargoboolfalse
nameName of the created GitHub check. If running this action multiple times, each run must have a unique name.stringclippy

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

NOTE: if your workflow contains multiple instances of the clippy-check action you will need to give each invocation a unique name, using the name property described above. Check runs must have a unique name, and this prevents a later check run overriding a previous one within the same workflow.

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.

cargo
clippy
github
lint
linter
pull-requests
rust
rust-lang

Contributors

svartalf

17 commits

freebroccolo

2 commits

dbalcomb

1 commits

actions-rs/clippy-check

📎 GitHub Action for PR annotations with clippy warnings

TypeScript

292

43 commits

updated Jan 10, 2023

See the code

README

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:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

Inputs

NameRequiredDescriptionTypeDefault
tokenGitHub secret token, usually a ${{ secrets.GITHUB_TOKEN }}string
toolchainRust toolchain to use; override or system default toolchain will be used if omittedstring
argsArguments for the cargo clippy commandstring
use-crossUse cross instead of cargoboolfalse
nameName of the created GitHub check. If running this action multiple times, each run must have a unique name.stringclippy

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

NOTE: if your workflow contains multiple instances of the clippy-check action you will need to give each invocation a unique name, using the name property described above. Check runs must have a unique name, and this prevents a later check run overriding a previous one within the same workflow.

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.

cargo
clippy
github
lint
linter
pull-requests
rust
rust-lang

Contributors

svartalf

17 commits

freebroccolo

2 commits

dbalcomb

1 commits

Languages

TypeScript

98.6%

JavaScript

1.4%