Skip to content

Commit 2413dc9

Browse files
committed
Consolidate lint management with workspaces
At the moment, most crates rely on build scripts and other methods to keep lint-consistency. As of recent, Rust can use workspaces to globally set all the lint configurations. This PR only adds lint configuration to each crate, but it does not introduce any changes to the code or lint configuration. In the subsequent PRs, I plan to gradually move lints from `uucore` to workspace, making all code consistent. Note that `seq` relies on a custom lint config - which means its configuration may need to be managed by hand until Cargo introduces per-crate overrides.
1 parent bb3b418 commit 2413dc9

File tree

103 files changed

+318
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+318
-0
lines changed

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,3 +584,13 @@ manual_let_else = "warn"
584584
all = { level = "deny", priority = -1 }
585585
cargo = { level = "warn", priority = -1 }
586586
pedantic = { level = "deny", priority = -1 }
587+
588+
# This is the linting configuration for all crates.
589+
# Eventually the clippy settings from the `[lints]` section should be moved here.
590+
# In order to use these, all crates have `[lints] workspace = true` section.
591+
[workspace.lints.rust]
592+
# unused_qualifications = "warn"
593+
594+
[workspace.lints.clippy]
595+
all = { level = "deny", priority = -1 }
596+
#cargo = { level = "warn", priority = -1 }

src/uu/arch/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/arch.rs"
1821

src/uu/base32/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/base32.rs"
1821

src/uu/base64/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/base64.rs"
1821

src/uu/basename/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/basename.rs"
1821

src/uu/basenc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/basenc.rs"
1821

src/uu/cat/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/cat.rs"
1821

src/uu/chcon/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ edition = "2024"
1212

1313
readme.workspace = true
1414

15+
[lints]
16+
workspace = true
17+
1518
[lib]
1619
path = "src/chcon.rs"
1720

src/uu/chgrp/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/chgrp.rs"
1821

src/uu/chmod/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2024"
1313

1414
readme.workspace = true
1515

16+
[lints]
17+
workspace = true
18+
1619
[lib]
1720
path = "src/chmod.rs"
1821

0 commit comments

Comments
 (0)