-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow multiple clippy.tomls and make them inherit from lower priority ones #10929
Conversation
r? @xFrednet (rustbot has picked a reviewer for you, use r? to override) |
Thank you for the PR, I would like to first discuss this feature in the next meeting before I do a full review. :) @rustbot label +I-nominated |
☔ The latest upstream changes (presumably #10916) made this pull request unmergeable. Please resolve the merge conflicts. |
I've made the new behavior opt-in through the I think that was the only issue before. |
I'll be on vacation for most of the week. I'll give this a proper review next week. cc: @blyxyas If you want you can review this PR :) |
Yeah, will review it (it will take some time though, it's a big PR), thanks for trying such a big project ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, it's a very good starting point. We should discuss a little bit some specifics. I think we should also include documentation about this feature in this same PR (or create a new one that gets merged before the rustc sync)
@rustbot label: +I-nominated
@@ -0,0 +1,4 @@ | |||
too-many-lines-threshold = 3 | |||
msrv = "1.1" | |||
# Will emit an error if uncommented, and revert to default config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extending this comment with the reason why an error will be emitted if uncommented would be very helpful (not having priority 0 AFAIK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a directory at the same level than inner
with a different clippy.toml
, to show that it should have the same inherited configs, but different local ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this option should be named workspace
, maybe a little bit confusing with Cargo workspaces. I think we can discuss about this in the next meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't like the name all too much either, but that was the only thing that came to mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like inherit_...
or extend_...
could work? These are also not totally convincing. Sometimes I stumble upon a good name while writing documentation, just based on which words I'm using there :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking something like inherit = true
but this feels odd, as inherit
usually means "this is the path to the thing I'm inheriting from". extend
could work maybe. Maybe inheritable
or extendable
, I don't know. Naming things is often the hardest part of this 😅
☔ The latest upstream changes (presumably #10426) made this pull request unmergeable. Please resolve the merge conflicts. |
Oh this is assigned on me, I forgot 💀. |
Ok, just as a reminder of what was said about this in the 2023-06-27 meeting:
|
Last I checked it was still pretty indecisive, so are we sure we're going with the top-level |
It was the winning option in the poll by 1 vote. (Maybe there has been another poll I haven't seen, but I think that's the conclusion (?)) |
Now that I had the chance to think about this more, I also prefer the child level
This brings the vote to a tie and doesn't help anyone 😅 So I think there is more room for discussion... |
Not in the case of The rest are great though, making it explicit in each child would make it more powerful (but also harder to implement ^^) |
I was more thinking about workspace attributes of crates, like |
Yeah I know, though I was pointing out that it doesn't really apply to cargo's own config (which is much similar to |
Mmmm... This is pretty correct. Maybe the user is already aware that they're in a workspace by the |
Just to be clear, I also agree that it should be in the child, moving my vote from parent to child. Meaning that the propierty should be |
I'm also in favor of declaring it in the child 👍 |
235 days since this was open, I think that we can safely declare this as stale. I'll close it, it can always be restarted! ヾ(=`ω´=)ノ” |
Good call! Tiny nit: In these cases, it's always a good idea, to also add the Meow Meow =°w°= |
This is a bit of a pain to test, but from my own testing it seems to work 🙂
Just one issue I know currently, see https://github.com/Centri3/rust-clippy/blob/560b6b7122f8de1295c4bfe66c8e7d314ae868b1/clippy_lints/src/utils/conf.rs#L571-L574
Closes #7353
changelog: Enhancement:
clippy.toml
can now be modified on a per-package basis