Skip to content

Commit

Permalink
build(lint): use cranky for manage clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Sep 22, 2023
1 parent f98a31d commit 4f123d8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
39 changes: 39 additions & 0 deletions Cranky.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
allow = []

deny = [
"clippy::complexity",
"clippy::expect_used",
"clippy::implicit_clone",
"clippy::manual_string_new",
"clippy::map_unwrap_or",
"clippy::match_same_arms",
"clippy::option_as_ref_deref",
"clippy::option_filter_map",
"clippy::option_map_unit_fn",
"clippy::or_then_unwrap",
"clippy::panic",
"clippy::range_plus_one",
"clippy::redundant_clone",
"clippy::redundant_closure_for_method_calls",
"clippy::semicolon_if_nothing_returned",
"clippy::single_match_else",
"clippy::unnecessary_cast",
"clippy::unnecessary_wraps",
"clippy::unused_self",
"clippy::unwrap_used",
"clippy::useless_asref",
"clippy::useless_conversion",
"clippy::useless_format",
"nonstandard-style",
"rust_2018_idioms",
"rust-2021-compatibility",
"trivial_casts",
"trivial_numeric_casts",
"unsafe_code",
"unused_import_braces",
"unused_lifetimes",
"unused_qualifications",
"warnings",
]

warn = []
22 changes: 9 additions & 13 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@ description = "Check format of sources files."
install_crate = { rustup_component_name = "rustfmt" }

[tasks.lint-rust]
args = [
"clippy",
"--workspace",
"--locked",
"--all-targets",
"--all-features",
"--",
"-D",
"clippy::all",
"-D",
"warnings",
]
args = ["cranky"]
command = "cargo"
dependencies = ["install-clippy"]
description = "Check lint of all sources files."
install_crate = { rustup_component_name = "clippy" }

[tasks.lint-toml]
args = ["lint"]
Expand Down Expand Up @@ -83,6 +72,13 @@ install_crate = { rustup_component_name = "llvm-tools-preview" }
[tasks.install-llvm-cov]
install_crate = { crate_name = "cargo-llvm-cov", min_version = "0.5.31" }

[tasks.install-clippy]
install_crate = { rustup_component_name = "clippy", min_version = "0.1.72" }

[tasks.intall-cranky]
dependencies = ["install-clippy"]
install_crate = { crate_name = "cargo-cranky", min_version = "0.3.0" }

[tasks.publish]
args = ["publish", "--token", "${CARGO_API_TOKEN}"]
command = "cargo"
Expand Down

0 comments on commit 4f123d8

Please sign in to comment.