-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Lints could have error codes #24900
Comments
I like it. We could even namespace lints differently, like L0001. |
Interesting. Namespacing has the downside of exposing implementation details that may not hold true in future, e.g. if a lint moves around/uses some different infrastructure it may no longer make sense to be classed as L..., but changing numbers isn't really possible. However, it seems likely to me that there is a hard distinction between lints and compiler errors that will always be true: the former has levels (including 'disabled'). |
I want to emphasize that the most useful portion of such lints would be an explanation of how to turn them off or suppress them, both globally or in the specific case. As such, perhaps it would make sense to have a generic reusable explanation of For the extended message for the dead_code case specifically, it might also make sense to have a pointer to |
How would this work with external lints? Should they have their own namespace? What happens if two plugins accidentially use the same error codes? Do we need a central registry? "What could go wrong?" — famous last quotes... |
Triage: no change |
Lints now have |
Lint messages don't always explain the error in much detail, and so would often benefit from a detailed
--explain
explanation just like normal errors, e.g. this will hit a dead_code warning, but that doesn't really help diagnose the problem (thatmod foo;
is private), a detailed explanation could include discussion of the privacy/modules aspect of the lint.It might also make sense to have a generic "lints" detailed explanation, that (a) lints that don't have their own error message point to, and (b) that any specific lint explanation also points to ("see also [E...] for more on lints"). This could include the common details of how the
allow
/etc. attributes work.On the other hand, lints may change too fast for this to make sense.
cc @michaelsproul #24407
The text was updated successfully, but these errors were encountered: