Skip to content

Commit

Permalink
rust-clippy: remove default lints
Browse files Browse the repository at this point in the history
Removes the default lints from the clippy exec.

Users should instead prefer to define them in source, or explicitly as args.
Previously defining them in the source was then overridden by the args, which
was confusing and produced the wrong results.
  • Loading branch information
domodwyer committed Jan 4, 2021
1 parent 1146f66 commit e43b3df
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions run-rust-clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@

set -euo pipefail

default_lints=(
"-D rust_2018_idioms"
"-D missing_debug_implementations"
"-D unreachable_pub"
"-D missing_docs"
"-A clippy::missing_docs_in_private_items"
"-D clippy::doc_markdown"
"-D clippy::todo"
"-D clippy::dbg_macro"
"-D clippy::unimplemented"
"-D clippy::await_holding_lock"
"-D clippy::match-like-matches-macro"
)
# Some sensible defaults:
# "-D rust_2018_idioms"
# "-D missing_debug_implementations"
# "-D unreachable_pub"
# "-D missing_docs"
# "-A clippy::missing_docs_in_private_items"
# "-D clippy::doc_markdown"
# "-D clippy::todo"
# "-D clippy::dbg_macro"
# "-D clippy::unimplemented"
# "-D clippy::await_holding_lock"
# "-D clippy::match-like-matches-macro"

# Use the lints passed as arguments, or the default above.
lints=${*:-${default_lints[*]}}

cargo clippy --all-targets --all-features -- -D warnings ${lints}
cargo clippy --all-targets --all-features -- -D warnings "$@"

0 comments on commit e43b3df

Please sign in to comment.