1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

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.
This commit is contained in:
Yuri Astrakhan 2025-04-09 03:12:36 -04:00
parent bb3b418052
commit 2413dc9168
103 changed files with 318 additions and 0 deletions

View file

@ -584,3 +584,13 @@ manual_let_else = "warn"
all = { level = "deny", priority = -1 } all = { level = "deny", priority = -1 }
cargo = { level = "warn", priority = -1 } cargo = { level = "warn", priority = -1 }
pedantic = { level = "deny", priority = -1 } pedantic = { level = "deny", priority = -1 }
# This is the linting configuration for all crates.
# Eventually the clippy settings from the `[lints]` section should be moved here.
# In order to use these, all crates have `[lints] workspace = true` section.
[workspace.lints.rust]
# unused_qualifications = "warn"
[workspace.lints.clippy]
all = { level = "deny", priority = -1 }
#cargo = { level = "warn", priority = -1 }

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/arch.rs" path = "src/arch.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/base32.rs" path = "src/base32.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/base64.rs" path = "src/base64.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/basename.rs" path = "src/basename.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/basenc.rs" path = "src/basenc.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/cat.rs" path = "src/cat.rs"

View file

@ -12,6 +12,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/chcon.rs" path = "src/chcon.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/chgrp.rs" path = "src/chgrp.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/chmod.rs" path = "src/chmod.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/chown.rs" path = "src/chown.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/chroot.rs" path = "src/chroot.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/cksum.rs" path = "src/cksum.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/comm.rs" path = "src/comm.rs"

View file

@ -17,6 +17,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/cp.rs" path = "src/cp.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/csplit.rs" path = "src/csplit.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/cut.rs" path = "src/cut.rs"

View file

@ -14,6 +14,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/date.rs" path = "src/date.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/dd.rs" path = "src/dd.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/df.rs" path = "src/df.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/dir.rs" path = "src/dir.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/dircolors.rs" path = "src/dircolors.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/dirname.rs" path = "src/dirname.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/du.rs" path = "src/du.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/echo.rs" path = "src/echo.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/env.rs" path = "src/env.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/expand.rs" path = "src/expand.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/expr.rs" path = "src/expr.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[build-dependencies] [build-dependencies]
num-traits = { workspace = true } # used in src/numerics.rs, which is included by build.rs num-traits = { workspace = true } # used in src/numerics.rs, which is included by build.rs

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/false.rs" path = "src/false.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/fmt.rs" path = "src/fmt.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/fold.rs" path = "src/fold.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/groups.rs" path = "src/groups.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/hashsum.rs" path = "src/hashsum.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/head.rs" path = "src/head.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/hostid.rs" path = "src/hostid.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/hostname.rs" path = "src/hostname.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/id.rs" path = "src/id.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/install.rs" path = "src/install.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/join.rs" path = "src/join.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/kill.rs" path = "src/kill.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/link.rs" path = "src/link.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/ln.rs" path = "src/ln.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/logname.rs" path = "src/logname.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/ls.rs" path = "src/ls.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/mkdir.rs" path = "src/mkdir.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/mkfifo.rs" path = "src/mkfifo.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
name = "uu_mknod" name = "uu_mknod"
path = "src/mknod.rs" path = "src/mknod.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/mktemp.rs" path = "src/mktemp.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/more.rs" path = "src/more.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/mv.rs" path = "src/mv.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/nice.rs" path = "src/nice.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/nl.rs" path = "src/nl.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/nohup.rs" path = "src/nohup.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/nproc.rs" path = "src/nproc.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/numfmt.rs" path = "src/numfmt.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/od.rs" path = "src/od.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/paste.rs" path = "src/paste.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/pathchk.rs" path = "src/pathchk.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/pinky.rs" path = "src/pinky.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/pr.rs" path = "src/pr.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/printenv.rs" path = "src/printenv.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/printf.rs" path = "src/printf.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/ptx.rs" path = "src/ptx.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/pwd.rs" path = "src/pwd.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/readlink.rs" path = "src/readlink.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/realpath.rs" path = "src/realpath.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/rm.rs" path = "src/rm.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/rmdir.rs" path = "src/rmdir.rs"

View file

@ -12,6 +12,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/runcon.rs" path = "src/runcon.rs"

View file

@ -34,6 +34,11 @@ uucore = { workspace = true, features = [
name = "seq" name = "seq"
path = "src/main.rs" path = "src/main.rs"
# FIXME: this is the only crate that has a separate lints configuration,
# which for now means a full copy of all clippy and rust lints here.
[lints.clippy]
all = { level = "deny", priority = -1 }
# Allow "fuzzing" as a "cfg" condition name # Allow "fuzzing" as a "cfg" condition name
# https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html # https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html
[lints.rust] [lints.rust]

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/shred.rs" path = "src/shred.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/shuf.rs" path = "src/shuf.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/sleep.rs" path = "src/sleep.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/sort.rs" path = "src/sort.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/split.rs" path = "src/split.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/stat.rs" path = "src/stat.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/stdbuf.rs" path = "src/stdbuf.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/stty.rs" path = "src/stty.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/sum.rs" path = "src/sum.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/sync.rs" path = "src/sync.rs"

View file

@ -15,6 +15,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tac.rs" path = "src/tac.rs"

View file

@ -14,6 +14,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tail.rs" path = "src/tail.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tee.rs" path = "src/tee.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/test.rs" path = "src/test.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/timeout.rs" path = "src/timeout.rs"

View file

@ -14,6 +14,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/touch.rs" path = "src/touch.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tr.rs" path = "src/tr.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/true.rs" path = "src/true.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/truncate.rs" path = "src/truncate.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tsort.rs" path = "src/tsort.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/tty.rs" path = "src/tty.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/uname.rs" path = "src/uname.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/unexpand.rs" path = "src/unexpand.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/uniq.rs" path = "src/uniq.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/unlink.rs" path = "src/unlink.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/uptime.rs" path = "src/uptime.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/users.rs" path = "src/users.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/vdir.rs" path = "src/vdir.rs"

View file

@ -13,6 +13,9 @@ edition = "2024"
readme.workspace = true readme.workspace = true
[lints]
workspace = true
[lib] [lib]
path = "src/wc.rs" path = "src/wc.rs"

Some files were not shown because too many files have changed in this diff Show more