Skip to content

chore: migrate lint configuration to [workspace.lints] in Cargo.toml #1786

@josecelano

Description

@josecelano

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:

  1. .cargo/config.toml RUSTFLAGS — rust-group denials invisible without reading the config
  2. torrust-linting clippy runner — only active when the linter tool runs
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions