Skip to content

Commit 4ce4b82

Browse files
committed
Enable default list of lints
Warn on a more reasonable list of lints and fix reported issues.
1 parent 81e1696 commit 4ce4b82

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

Cargo.toml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
[workspace]
2+
members = ["macros"]
3+
4+
[lworkspace.ints.rust]
5+
deprecated-safe = "warn"
6+
future-incompatible = "warn"
7+
keyword-idents = "warn"
8+
let-underscore = "warn"
9+
missing-debug-implementations = "warn"
10+
missing-docs = "warn"
11+
trivial-numeric-casts = "warn"
12+
unsafe-op-in-unsafe-fn = "warn"
13+
unused = "warn"
14+
15+
[workspace.lints.clippy]
16+
collapsible-else-if = "allow"
17+
collapsible-if = "allow"
18+
diverging-sub-expression = "allow"
19+
let-and-return = "allow"
20+
let-unit-value = "allow"
21+
module-inception = "allow"
22+
type-complexity = "allow"
23+
absolute-paths = "warn"
24+
allow-attributes = "warn"
25+
clone-on-ref-ptr = "warn"
26+
dbg-macro = "warn"
27+
derive-partial-eq-without-eq = "warn"
28+
doc-markdown = "warn"
29+
join-absolute-paths = "warn"
30+
large-enum-variant = "warn"
31+
redundant-closure-for-method-calls = "warn"
32+
unchecked-duration-subtraction = "warn"
33+
uninlined-format-args = "warn"
34+
wildcard-imports = "warn"
35+
136
[package]
237
name = "test-log"
338
version = "0.2.17"
@@ -41,9 +76,6 @@ color = ["env_logger?/auto-color", "tracing-subscriber?/ansi"]
4176
# versioning guarantees.
4277
unstable = ["test-log-macros/unstable"]
4378

44-
[workspace]
45-
members = ["macros"]
46-
4779
[dependencies]
4880
test-log-macros = {version = "0.2.15", path = "macros"}
4981
tracing-subscriber = {version = "0.3.17", default-features = false, optional = true, features = ["env-filter", "fmt"]}
@@ -54,3 +86,6 @@ logging = {version = "0.4.8", package = "log"}
5486
test-case = {version = "3.1"}
5587
tokio = {version = "1.0", default-features = false, features = ["rt-multi-thread", "macros"]}
5688
tracing = {version = "0.1.20"}
89+
90+
[lints]
91+
workspace = true

macros/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ unstable = []
2222
proc-macro2 = {version = "1.0.32", default-features = false}
2323
quote = {version = "1.0", default-features = false}
2424
syn = {version = "2.0", default-features = false, features = ["full", "parsing", "printing", "proc-macro"]}
25+
26+
[lints]
27+
workspace = true

macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn expand_logging_init(attribute_args: &AttributeArgs) -> Tokens {
158158
let default_filter = attribute_args
159159
.default_log_filter
160160
.as_ref()
161-
.unwrap_or(&::std::borrow::Cow::Borrowed("info"));
161+
.unwrap_or(&Cow::Borrowed("info"));
162162

163163
quote! {
164164
{

tests/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// Copyright (C) 2019-2024 Daniel Mueller <deso@posteo.net>
1+
// Copyright (C) 2019-2025 Daniel Mueller <deso@posteo.net>
22
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
33

4-
#![allow(clippy::eq_op)]
5-
64
use tokio::runtime::Builder;
75

86
use tracing::debug;

0 commit comments

Comments
 (0)