Summary
Migrate the ad-hoc lint configuration currently spread across .cargo/config.toml RUSTFLAGS and torrust-linting CLI arguments into a single [workspace.lints] section in Cargo.toml, following the idiomatic Cargo approach.
Background
Lint enforcement is split across three places:
.cargo/config.toml RUSTFLAGS — rust-group denials invisible without reading the config
torrust-linting clippy runner — only active when the linter tool runs
- Root
[lints.clippy] package section — not propagated to other workspace members; also contains a needless_return = "allow" marked # temp allow this lint whose original reason is unknown
Suggested in PR #1784 review by @da2ce7, referencing the torrust-index configuration as the target state.
Spec
Full implementation spec: docs/issues/open/ (after this issue is created the draft will be moved there)
Tasks (summary)
- T1: Add
[workspace.lints.rust] to root Cargo.toml
- T2: Add
[workspace.lints.clippy] to root Cargo.toml
- T3: Remove lint entries from RUSTFLAGS in
.cargo/config.toml
- T4: Remove root
[lints.clippy] package section
- T5: Fix any new lint failures
- T6: Coordinate
torrust-linting cleanup (remove redundant -D clippy::X flags)
- T7: Investigate and resolve
needless_return = "allow"
- T8: Verify all quality gates pass
Related to #1784
Summary
Migrate the ad-hoc lint configuration currently spread across
.cargo/config.tomlRUSTFLAGS andtorrust-lintingCLI arguments into a single[workspace.lints]section inCargo.toml, following the idiomatic Cargo approach.Background
Lint enforcement is split across three places:
.cargo/config.tomlRUSTFLAGS — rust-group denials invisible without reading the configtorrust-lintingclippy runner — only active when the linter tool runs[lints.clippy]package section — not propagated to other workspace members; also contains aneedless_return = "allow"marked# temp allow this lintwhose original reason is unknownSuggested in PR #1784 review by @da2ce7, referencing the
torrust-indexconfiguration as the target state.Spec
Full implementation spec:
docs/issues/open/(after this issue is created the draft will be moved there)Tasks (summary)
[workspace.lints.rust]to rootCargo.toml[workspace.lints.clippy]to rootCargo.toml.cargo/config.toml[lints.clippy]package sectiontorrust-lintingcleanup (remove redundant-D clippy::Xflags)needless_return = "allow"Related to #1784