Skip to content

Commit

Permalink
Start running Clippy on CI
Browse files Browse the repository at this point in the history
This commit configures our CI to run `cargo clippy --workspace` for all
merged PRs. Historically this hasn't been all the feasible due to the
amount of configuration required to control the number of warnings on
CI, but with Cargo's new `[lint]` table it's possible to have a
one-liner to silence all lints from Clippy by default. This commit by
default sets the `all` lint in Clippy to `allow` to by-default disable
warnings from Clippy. The goal of this PR is to enable selective access
to Clippy lints for Wasmtime on CI.
  • Loading branch information
alexcrichton committed Nov 20, 2023
1 parent eb9e240 commit e351a2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ jobs:
- run: cargo install --root ${{ runner.tool_cache }}/cargo-ndk --version ${{ env.CARGO_NDK_VERSION }} cargo-ndk
- run: cargo ndk -t arm64-v8a check -p wasmtime

# Run clippy configuration
- run: rustup component add clippy
- run: cargo clippy --workspace

# common logic to cancel the entire run if this job fails
- run: gh run cancel ${{ github.run_id }}
if: failure() && github.event_name != 'pull_request'
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ trivial_numeric_casts = 'warn'
unstable_features = 'warn'
unused_import_braces = 'warn'

[workspace.lints.clippy]
all = 'allow'

[workspace.dependencies]
arbitrary = { version = "1.3.1" }
wasmtime-wmemcheck = { path = "crates/wmemcheck", version = "=16.0.0" }
Expand Down
2 changes: 0 additions & 2 deletions crates/c-api/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//! These are intended to mirror the macros in the `wasm.h` header file and
//! largely facilitate the `declare_ref` macro.

extern crate proc_macro;

use proc_macro2::{Ident, TokenStream, TokenTree};
use quote::quote;

Expand Down

0 comments on commit e351a2b

Please sign in to comment.