Skip to content
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

Integrating configuration into Cargo.toml #10

Open
Nemo157 opened this issue Oct 27, 2022 · 4 comments
Open

Integrating configuration into Cargo.toml #10

Nemo157 opened this issue Oct 27, 2022 · 4 comments

Comments

@Nemo157
Copy link

Nemo157 commented Oct 27, 2022

Recently I was getting annoyed at how many metadata files are in the root of my workspace. To combat this issue it feels like tooling that is completely cargo-focused like this should really be storing its configuration in the Cargo.toml. The example from the readme could look like:

[workspace.metadata.lints]
warn = [
  "clippy::empty_structs_with_brackets",
  "clippy::cast_possible_truncation",
]

This could also support some of the usecases from #3 easily. The lints could be merged from workspace.metadata.lints and package.metadata.lints to support crate-specific overrides.

@ericseppanen
Copy link
Owner

Good point, it never occurred to me to put the configuration in Cargo.toml.

Do guidelines exist for how third-party tools should organize their configuration data? Should a tool called cargo-cranky keep its config data under package.metadata.cranky?

@jayvdb
Copy link

jayvdb commented Sep 29, 2023

nightly now supports a top level lints in Cargo.toml, c.f. rust-lang/cargo#12115

The usefulness of cargo-cranky will steeply diminish soon, unless cranky decides to add more features not found in nightly.

Do guidelines exist for how third-party tools should organize their configuration data? Should a tool called cargo-cranky keep its config data under package.metadata.cranky?

IMO package.metadata.cranky would be better, but package.metadata.lints also makes sense, and it isnt going to have clashes any time soon because most people will be using the new nightly lints table soon.

@Nemo157
Copy link
Author

Nemo157 commented Sep 29, 2023

Not just nightly, 1.74 which is going to beta in a week has that feature stabilized.

@ericseppanen
Copy link
Owner

That's great news! I'll update the README when 1.74 comes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants