Skip to content

Workspace lints should have the option to be opt-out rather then opt-in #12984

@Jasper-Bekkers

Description

@Jasper-Bekkers

Problem

The newly introduced [lints] section has a fatal flaw for our codebase, which is that we define all of our lints in our root workspace, but then have to opt in, in every crate, to those lints through [lints] workspace = true.

This means, for us, that we need to audit the Cargo.toml files every code review to make sure we didn't accidentally miss adding this line to the toml file. This introduces an additional manual workflows: a reviewer manually needs to check that it's present. (It looks from #12174 that at least cargo new adds the line automatically)

Proposed Solution

Ideally we can force clippy lints for the entire workspace rather then having them be opt-in for every crate.

Currently we're using the rustflags hack to accomplish this and while I'd love to move away from it in due time, the 1.74 release unfortunately can't be the release that does this for us.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions