Skip to content

New lint: missing_workspace_lints #15092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BenjaminBrienen
Copy link

@BenjaminBrienen BenjaminBrienen commented Jun 21, 2025

Adds a new lint for when your workspace has a lint configuration table, but a member of the workspace implicitly does not inherit that configuration. This has bitten me in the butt many times in my large workspace with many crates where I forget to add lints.workspace = true.

Example in rust-analyzer!

Worked on with @NateD-MSFT during the RustWeek workshop.

changelog: [missing_workspace_lints]: Added new lint to warn when a project is in a workspace with workspace lint configuration, but has not explicitly configured lints.workspace.

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 21, 2025
@BenjaminBrienen BenjaminBrienen force-pushed the unused-workspace-lints branch 3 times, most recently from 1e4b341 to 9ecf6da Compare June 21, 2025 01:26
@BenjaminBrienen BenjaminBrienen force-pushed the unused-workspace-lints branch from 9ecf6da to 9d20899 Compare June 21, 2025 01:28
@samueltardieu
Copy link
Contributor

I think this should be a Cargo lint instead. "lints" are probably not the only key which should be checked, for example edition, rust-version and license should be as well.

@samueltardieu
Copy link
Contributor

Worked on with @NateD-MSFT during the RustWeek workshop.

r? @llogiq

@rustbot rustbot assigned llogiq and unassigned samueltardieu Jun 21, 2025
@BenjaminBrienen
Copy link
Author

Clippy already has a few cargo lints and I think it even checks for missing basic metadata (allow by default). If they get moved into cargo itself, this could move with them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants