Skip to content

Commit

Permalink
Move remaining clippy lint definitions to Cargo.toml (#10672)
Browse files Browse the repository at this point in the history
# Objective

Partially addresses #10612
After moving the initial docs_markdown warning, this is a PR that moves
the rest of the CI clippy lint definitions to the cargo.toml.

## Solution

- the `tools/ci/src/main.rs` clippy lints removed and just the warning
flag remains.
- the warnings moved to the root cargo workspace toml.
  • Loading branch information
AlexOkafor authored Nov 28, 2023
1 parent 6d0c11a commit 3c2cbb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ members = [
type_complexity = "allow"
doc_markdown = "warn"
undocumented_unsafe_blocks = "warn"
redundant_else = "warn"
match_same_arms = "warn"
semicolon_if_nothing_returned = "warn"
map_flatten = "warn"

[lints]
workspace = true
Expand Down
10 changes: 1 addition & 9 deletions tools/ci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ bitflags! {
}
}

const CLIPPY_FLAGS: [&str; 5] = [
"-Wclippy::redundant_else",
"-Wclippy::match_same_arms",
"-Wclippy::semicolon_if_nothing_returned",
"-Wclippy::map_flatten",
"-Dwarnings",
];

fn main() {
// When run locally, results may differ from actual CI runs triggered by
// .github/workflows/ci.yml
Expand Down Expand Up @@ -79,7 +71,7 @@ fn main() {
// - Type complexity must be ignored because we use huge templates for queries
cmd!(
sh,
"cargo clippy --workspace --all-targets --all-features -- {CLIPPY_FLAGS...}"
"cargo clippy --workspace --all-targets --all-features -- -Dwarnings"
)
.run()
.expect("Please fix clippy errors in output above.");
Expand Down

0 comments on commit 3c2cbb8

Please sign in to comment.