-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
new lint: struct_added_without_non_exhaustive
#1091
base: main
Are you sure you want to change the base?
new lint: struct_added_without_non_exhaustive
#1091
Conversation
These lints might be quite noisy, and some of our users may find them annoying. I think we should consider them equivalent to clippy's If that sounds right, switch the lint level to While lints like this are in general nice to have, they aren't necessarily the most impactful things we could add, for two reasons:
I'm definitely not opposed to having this lint, and I'd happily merge it with a bit of polish. But there are also definitely more impactful lints that haven't been written yet. For example, #57 has a bunch of suggestions; I'll write up even more next week. |
id: "struct_added_without_non_exhaustive", | ||
human_readable_name: "pub struct added without #[non_exhaustive]", | ||
description: "A new public struct was added without #[non_exhaustive], making it harder to evolve in the future.", | ||
required_update: Minor, |
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.
Since we don't have any prior "API evolution" advisory lints like this one (this is the first!), we haven't thought through what required_update
should be here.
Right now, the only allowed options are Major
and Minor
. But neither seems quite right. Selecting Minor
means that this lint won't run on major or minor releases, so new API additions like this will only be linted in patch releases. This doesn't seem quite right =/
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.
hmm I see Minor
is not right I believe, should we put it on-hold till we figure it out
Yeah make sense to me. I would do it.
I would give them a try! |
Co-authored-by: Predrag Gruevski <[email protected]>
I updated my comment above with a bit more detail -- just making sure you see it since I think GitHub won't notify on edits :) |
Yeah, possibly — depending on how much work you're open to doing here :)
This is why that other PR stalled too.
…On Fri, Jan 31, 2025, 11:23 AM frankwang ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/lints/struct_added_without_non_exhaustive.ron
<#1091 (comment)>
:
> @@ -0,0 +1,57 @@
+SemverQuery(
+ id: "struct_added_without_non_exhaustive",
+ human_readable_name: "pub struct added without #[non_exhaustive]",
+ description: "A new public struct was added without #[non_exhaustive], making it harder to evolve in the future.",
+ required_update: Minor,
hmm I see Minor is not right I believe, should we put it on-hold till we
figure it out
—
Reply to this email directly, view it on GitHub
<#1091 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR5MSRKRUUBD7YLVJV3CR32NOPQXAVCNFSM6AAAAABWH4J4VWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOBXGIYTQNBZGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Okay, let me make it a draft then. |
since #495 has been stale for a while.
related: #949
I don't know why the new
lib.rs
line: 25 would trigger the lint, I think the query should be correct?