-
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
Take stock of and evaluate the lint situation. #1501
Comments
I am all for moving some of the clippy lints into rustc itself. Some of these fits better in the compiler itself, than a seperate plugin. |
FWIW in the future clippy may have more. Normal lints will be Warn, and Allow lints will be classified in three or more groups:
I think at the very least if we're not going to be expanding the number of lints in clippy, we should make it easy to
I personally don't have any strong opinion here. As far as vision is concerned I am very much for more static checks, and think that Rust as a community should also lean that way (AFAICT it does already) -- if it can be checked at compile time, it should be. Beyond that, I don't care where the static checks live; they could be in clippy or rustc or both. I do feel that we should try uplifting lints from clippy to rustc more often (ones which have zero false positives and are consistently liked), though.
For customization, clippy eventually wants to get a
Lints which are Clippy hasn't gone 1.0 yet because I plan to RfC the defaults once before that, but afterwards the above was how I roughly planned to think about stability.
Infinity? |
Since the compiler-internals (HIR) will never be stable as far as I understand, but there will be some kind of interface to rustc for IDEs (I'm guessing that these will be stable at some point), we can port the lints to the IDE-interface once that time comes. AST-lints can be stabilized either through something like syntex or when the AST becomes stable.
The ability to create static analysis without much effort is imo a major plus for Rust. We should not be fixing bugs, we should be fixing classes of bugs. Whenever I have an itch b/c of something that can easily be detected, I end up writing a lint to detect it for me. |
Closing in favor of rust-lang/rust#53224. |
We currently have a bunch of lints in the compiler (listed here: librustc/lint/builtin.rs) and a lot more in Clippy. Which lints exist and where they exist is pretty much historical accident - in the past we added lints to the compiler, more recently we've tried to avoid adding them to the compiler and instead added them to Clippy. Clippy in turn has (AIUI) two ranks of lints - normal and pedantic.
We don't have much of a vision for how lints fit into the Rust universe, and we should (where they should live, how many there should be, how they should work, how they can be customised, some kind of stability story). Furthermore, we should rationalise the current situation.
cc @rust-lang/tools, @Manishearth, @llogiq
The text was updated successfully, but these errors were encountered: