-
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
Findings from running Clippy on Servo #164
Comments
I think our macro checking should be stronger, perhaps with some specific checks to totally ignore derive or even all plugins |
Although I don't like it, I think it's fair enough to let people use |
I'd really like to see how the spans for derive-macros look. Will have to investigate. |
This seems to be a rustc bug btw |
Our |
Even a lint that is allow by default can have some value – if people care enough to use it, e.g. per-project. |
Until that gets fixed, keeping the let lint on allow for servo |
Btw, I'd love for a way to configure allows/warns dynamically |
What do you mean by "dynamically"? |
I'm running the "servo" branch of Clippy on servo, btw. Not all lints changed to |
Oh, sorry, that was a drive-by comment without context. Basically, it would be nice if once could specify the matrix of allow/warn/deny when Even if there was a way to do this as a Cargo feature it would be fine. The idea is that the set of allow/warn/denys can be changed for an entire codebase, instead of per-lib. |
https://github.com/Manishearth/rust-clippy/compare/servo Feel free to pick up fixes from here as they appear and hoist them to master |
I have an open cargo issue here (actually huon filed it then, after I had asked how to do it on StackOverflow). |
First batch of Servo improvements. This is a small chunk of overall linted stuff. https://github.com/servo/servo/pull/7224/files Full list of warnings (with some filtered out): https://gist.github.com/Manishearth/f127d1353586b8ebb271 |
Awesome! |
Magnificient! I was a bit surprised to see so many needless returns, then again there are probably a lot of C++ coders on the servo team who by necessity switch languages ever so often. I recently notice that I'm missing parentheses in if expressions when writing Java... |
A lot of the needless returns come from the way the specs are written. And for each needless return, there are tons of bare returns, so I think it's just a matter of Servo being a large codebase. |
@Manishearth Now that we fixed the Btw. should we change Also should we shorten the code snippet in Btw.
|
Wouldn't |
Unless we have another "newb-only" lint that I have missed, yes. Btw. I was a bit shocked to find a |
In Servo I plan to run it off a branch where the defaults are changed. (Too annoying to pepper
|
Current run of clippy: https://gist.github.com/Manishearth/4fa159d16375a521871b |
I think this is a false positive:
The index isn't used to get, but to put. The following shows that we may want to tweak our threshold:
That doesn't look to scary, though a The shadow lint could probably use a note of the shadowed declaration. I've opened #288 to track this. Counting lint occurrences again:
|
Perhaps |
Can't that be handled via a mutable iteration? Anyway, if you want to handle it, replace the regular visitor with I'm not sure what the |
Bunch of fixes landed (fixing the gist updated. I'll probably continue to tack on fixes as time passes, but feel free to try it out yourself and make a PR (making a PR to my clippyfix branch will also work and keep efforts in one place). Ignore lints in generated files, for now. |
(I'll update as I move forward)
in_external_macro
, otherwise it lints on all derived thingies. We should find other lints that are prone to lint onderive
too.option_unwrap_unused
has too many false positives (places where it is known to exist, for example), and in general unwrap seems pervasive throughout Servo and other Rust codebases. I vote we move this to Allow.PRs: servo/servo#7224, servo/servo#7536, servo/servo#7519
The text was updated successfully, but these errors were encountered: