Skip to content

Lint if workspace dependency inheritance isn't used #15578

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
epage opened this issue May 22, 2025 · 1 comment
Open

Lint if workspace dependency inheritance isn't used #15578

epage opened this issue May 22, 2025 · 1 comment
Labels
A-new-lint Area: new lint S-triage Status: This issue is waiting on initial triage.

Comments

@epage
Copy link
Contributor

epage commented May 22, 2025

What it does

If a package has a dependencies entry that specifies a source besides workspace = true, it fires

See also rust-lang/rust-clippy#10306

Advantage

For projects that want to be consistent on their dependencies across a workspace

Drawbacks

Example

[dependencies]
serde = "1"

Could be written as:

[workspace.dependencies]
serde = "1"

[dependencies]
serde.workspace = true
@epage epage added S-triage Status: This issue is waiting on initial triage. A-new-lint Area: new lint labels May 22, 2025
@epage epage changed the title Lint that workspace inheritance is always used Lint if workspace inheritance isn't used May 22, 2025
@epage
Copy link
Contributor Author

epage commented May 22, 2025

Alternatively, cargo-deny focuses on de-duplication, see https://embarkstudios.github.io/cargo-deny/checks/bans/diags.html#workspace-duplicate

@epage epage changed the title Lint if workspace inheritance isn't used Lint if workspace dependency inheritance isn't used May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-new-lint Area: new lint S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

1 participant