mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-28 08:27:29 +00:00
Use rust 1.74.0 in CI and move clippy lints to Cargo.toml (#4170)
* ci rust 1.74.0 * do it * Update .woodpecker.yml * Update Cargo.toml * Update lint.sh * Update lib.rs --------- Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
62357f4444
commit
30f7135f32
|
@ -2,7 +2,7 @@
|
|||
# See https://github.com/woodpecker-ci/woodpecker/issues/1677
|
||||
|
||||
variables:
|
||||
- &rust_image "rust:1.72.1"
|
||||
- &rust_image "rust:1.74.0"
|
||||
- &slow_check_paths
|
||||
- path:
|
||||
# rust source code
|
||||
|
@ -163,21 +163,7 @@ steps:
|
|||
commands:
|
||||
# when adding new clippy lints, make sure to also add them in scripts/lint.sh
|
||||
- rustup component add clippy
|
||||
- cargo clippy --workspace --tests --all-targets --features console --
|
||||
-D warnings -D deprecated -D clippy::perf -D clippy::complexity
|
||||
-D clippy::style -D clippy::correctness -D clippy::suspicious
|
||||
-D clippy::dbg_macro -D clippy::inefficient_to_string
|
||||
-D clippy::items-after-statements -D clippy::implicit_clone
|
||||
-D clippy::cast_lossless -D clippy::manual_string_new
|
||||
-D clippy::redundant_closure_for_method_calls
|
||||
-D clippy::unused_self
|
||||
-A clippy::uninlined_format_args
|
||||
-D clippy::get_first
|
||||
-D clippy::explicit_into_iter_loop
|
||||
-D clippy::explicit_iter_loop
|
||||
-D clippy::needless_collect
|
||||
-D clippy::unwrap_used
|
||||
-D clippy::indexing_slicing
|
||||
- cargo clippy --workspace --tests --all-targets --features console -- -D warnings
|
||||
when: *slow_check_paths
|
||||
|
||||
cargo_build:
|
||||
|
|
25
Cargo.toml
25
Cargo.toml
|
@ -20,6 +20,9 @@ repository.workspace = true
|
|||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[profile.release]
|
||||
debug = 0
|
||||
lto = "thin"
|
||||
|
@ -58,6 +61,28 @@ members = [
|
|||
"crates/federate",
|
||||
]
|
||||
|
||||
[workspace.lints.clippy]
|
||||
cast_lossless = "deny"
|
||||
complexity = "deny"
|
||||
correctness = "deny"
|
||||
dbg_macro = "deny"
|
||||
explicit_into_iter_loop = "deny"
|
||||
explicit_iter_loop = "deny"
|
||||
get_first = "deny"
|
||||
implicit_clone = "deny"
|
||||
indexing_slicing = "deny"
|
||||
inefficient_to_string = "deny"
|
||||
items-after-statements = "deny"
|
||||
manual_string_new = "deny"
|
||||
needless_collect = "deny"
|
||||
perf = "deny"
|
||||
redundant_closure_for_method_calls = "deny"
|
||||
style = "deny"
|
||||
suspicious = "deny"
|
||||
uninlined_format_args = "allow"
|
||||
unused_self = "deny"
|
||||
unwrap_used = "deny"
|
||||
|
||||
[workspace.dependencies]
|
||||
lemmy_api = { version = "=0.19.0-rc.5", path = "./crates/api" }
|
||||
lemmy_api_crud = { version = "=0.19.0-rc.5", path = "./crates/api_crud" }
|
||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_api"
|
|||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
lemmy_utils = { workspace = true }
|
||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_api_common"
|
|||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = [
|
||||
"tracing",
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
documentation.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
lemmy_utils = { workspace = true }
|
||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_apub"
|
|||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
lemmy_utils = { workspace = true }
|
||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_db_schema"
|
|||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = [
|
||||
"diesel",
|
||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
|||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = [
|
||||
"lemmy_utils",
|
||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
|||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
|||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@ repository.workspace = true
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
lemmy_api_common.workspace = true
|
||||
lemmy_apub.workspace = true
|
||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
|||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
lemmy_utils = { workspace = true }
|
||||
lemmy_db_views = { workspace = true }
|
||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_utils"
|
|||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
full = ["ts-rs"]
|
||||
|
||||
|
|
|
@ -5,21 +5,7 @@ CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|||
|
||||
cd $CWD/../
|
||||
|
||||
cargo clippy --workspace --fix --allow-staged --allow-dirty --tests --all-targets --all-features -- \
|
||||
-D warnings -D deprecated -D clippy::perf -D clippy::complexity \
|
||||
-D clippy::style -D clippy::correctness -D clippy::suspicious \
|
||||
-D clippy::dbg_macro -D clippy::inefficient_to_string \
|
||||
-D clippy::items-after-statements -D clippy::implicit_clone \
|
||||
-D clippy::wildcard_imports -D clippy::cast_lossless \
|
||||
-D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls \
|
||||
-D clippy::unused_self \
|
||||
-A clippy::uninlined_format_args \
|
||||
-D clippy::get_first \
|
||||
-D clippy::explicit_into_iter_loop \
|
||||
-D clippy::explicit_iter_loop \
|
||||
-D clippy::needless_collect \
|
||||
-D clippy::unwrap_used \
|
||||
-D clippy::indexing_slicing
|
||||
cargo clippy --workspace --fix --allow-staged --allow-dirty --tests --all-targets --all-features -- -D warnings
|
||||
|
||||
# Format rust files
|
||||
cargo +nightly fmt
|
||||
|
|
Loading…
Reference in a new issue