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
Make Clippy happier #2975
Make Clippy happier #2975
Conversation
Still 12 warnings to go, mostly related to function naming conventions and the RefCell over await point issues:
Note that changing
results in a build failure :-/ |
It would be great if there was a cross-workspace way to disable some lints. There is not though, so tweaking clippy.toml to make two tests less strict is the best I can do project wide. |
* Configure clippy to not report about type complexity until *much* later * Configure clippy to only complain about more than 10 function arguments * Properly format safety sections * Allow unnecessary main functions in doctests in the slint API crate * AccessKit: Move big block of code before if condition
I think I fixed all the non-clippy related things that were commented on. I am not sure what to do about the things clippy actually complains about and that were not universally liked: There is not that much I can do about that:-/ We can disable individual warnings, but only on a per-crate basis. I really do not want to go around and add the same set disable-clippy-flags into all our crates. I also do not want to disable clippy for individual statements: The boilerplate is more ugly than the change clippy encourages. I also am no fan of some script that runs clippy with special flags: |
Both of my comments are marked as resolved but the code is still exactly the same and I don't see a response. Did you choose to ignore them? |
@tronical: I can make either clippy happy or you:-( So I ignored them, even though I should change that conditional as you suggested. I'll do so right away. If the goal is to make clippy happy, then I have the following options:
The first option is the least annoying overall for me. About tweaking clippy for our project: There is no good way to set up clippy for a workspace at this time. There are tons of issues open with clippy, cargo and rustc, but no good solution. The best option right now seems to hard-code compiler flags into the project-wide I already did a bit of tweaking with We could have a script to run clippy with the configuration we want. I do not like that too much though as that does not help when somebody runs Finally we could copy/paste the same boilerplate clippy configuration into all our lib.rs/main.rs files. That will be annoying to do, but maybe some xtask could make that bearable? |
I don't feel too strong about it, I was just curious what you thought about the comments. Silently resolving them gave a third state that I didn't expect. I'm fine with keeping clippy happy. |
There is the option to change the code in a way that's good while keeping clippy happy. |
I do not think any of these makes the code worse, but some do not improve the code either. I understood most comments here as clarification as to why clippy suggested a change and only a few as actual complaints about how the code looks like now. |
This gets us down from 688 warnings to less than 50. Lots of changes, but all pretty straight forward and localized.
main
functions in doctests (which we want as that documents how to use things)That's it... The RefCall across await points is something we should eventually look into, but nothing I want to do close to release:-)
We are getting close to a point where it makes sense to run clippy without drowning in noise!