mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-24 15:26:20 +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
|
# See https://github.com/woodpecker-ci/woodpecker/issues/1677
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &rust_image "rust:1.72.1"
|
- &rust_image "rust:1.74.0"
|
||||||
- &slow_check_paths
|
- &slow_check_paths
|
||||||
- path:
|
- path:
|
||||||
# rust source code
|
# rust source code
|
||||||
|
@ -163,21 +163,7 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
# when adding new clippy lints, make sure to also add them in scripts/lint.sh
|
# when adding new clippy lints, make sure to also add them in scripts/lint.sh
|
||||||
- rustup component add clippy
|
- rustup component add clippy
|
||||||
- cargo clippy --workspace --tests --all-targets --features console --
|
- cargo clippy --workspace --tests --all-targets --features console -- -D warnings
|
||||||
-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
|
|
||||||
when: *slow_check_paths
|
when: *slow_check_paths
|
||||||
|
|
||||||
cargo_build:
|
cargo_build:
|
||||||
|
|
25
Cargo.toml
25
Cargo.toml
|
@ -20,6 +20,9 @@ repository.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
debug = 0
|
debug = 0
|
||||||
lto = "thin"
|
lto = "thin"
|
||||||
|
@ -58,6 +61,28 @@ members = [
|
||||||
"crates/federate",
|
"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]
|
[workspace.dependencies]
|
||||||
lemmy_api = { version = "=0.19.0-rc.5", path = "./crates/api" }
|
lemmy_api = { version = "=0.19.0-rc.5", path = "./crates/api" }
|
||||||
lemmy_api_crud = { version = "=0.19.0-rc.5", path = "./crates/api_crud" }
|
lemmy_api_crud = { version = "=0.19.0-rc.5", path = "./crates/api_crud" }
|
||||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_api"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_api_common"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = [
|
full = [
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
||||||
documentation.workspace = true
|
documentation.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_apub"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_db_schema"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = [
|
full = [
|
||||||
"diesel",
|
"diesel",
|
||||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = [
|
full = [
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
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
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_api_common.workspace = true
|
lemmy_api_common.workspace = true
|
||||||
lemmy_apub.workspace = true
|
lemmy_apub.workspace = true
|
||||||
|
|
|
@ -11,6 +11,9 @@ repository.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
lemmy_db_views = { workspace = true }
|
lemmy_db_views = { workspace = true }
|
||||||
|
|
|
@ -13,6 +13,9 @@ name = "lemmy_utils"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["ts-rs"]
|
full = ["ts-rs"]
|
||||||
|
|
||||||
|
|
|
@ -5,21 +5,7 @@ CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||||
|
|
||||||
cd $CWD/../
|
cd $CWD/../
|
||||||
|
|
||||||
cargo clippy --workspace --fix --allow-staged --allow-dirty --tests --all-targets --all-features -- \
|
cargo clippy --workspace --fix --allow-staged --allow-dirty --tests --all-targets --all-features -- -D warnings
|
||||||
-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
|
|
||||||
|
|
||||||
# Format rust files
|
# Format rust files
|
||||||
cargo +nightly fmt
|
cargo +nightly fmt
|
||||||
|
|
Loading…
Reference in a new issue