-
Notifications
You must be signed in to change notification settings - Fork 27
chore: enable clippy nursery and pedantic rules #262
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
Conversation
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.
Pull Request Overview
This PR enables clippy's nursery and pedantic rulesets while temporarily disabling all rules that currently trigger violations. This establishes a foundation for gradually fixing and enforcing stricter code quality rules one by one.
Key changes:
- Enables
clippy::nurseryandclippy::pedanticlints across modules - Adds comprehensive
#![allow(...)]blocks to disable currently triggered rules - Sets up framework for incremental code quality improvements
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| harbor-ui/src/main.rs | Adds clippy configuration with 40+ temporarily disabled rules |
| harbor-client/src/lib.rs | Adds clippy configuration with 30+ temporarily disabled rules |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
harbor-ui/src/main.rs
Outdated
| clippy::uninlined_format_args, | ||
| clippy::unreadable_literal, | ||
| clippy::unused_self, | ||
| clippy::use_self |
Copilot
AI
Aug 20, 2025
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.
[nitpick] The allow list is quite extensive (40+ rules). Consider adding comments explaining the rationale for disabling specific rule categories (e.g., casting rules, documentation rules, performance rules) to help future developers understand which rules should be prioritized for fixing.
| clippy::use_self | |
| clippy::uninlined_format_args, | |
| clippy::unreadable_literal, | |
| clippy::unused_self, | |
| clippy::use_self, | |
| // --- Performance and maintainability: Disabled for pragmatic reasons, revisit in future. | |
| clippy::suboptimal_flops, | |
| clippy::too_many_lines |
| clippy::unnecessary_wraps, | ||
| clippy::unused_async, | ||
| clippy::use_self | ||
| )] |
Copilot
AI
Aug 20, 2025
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.
[nitpick] Consider adding comments to group related rules (e.g., casting, documentation, performance) and include a tracking issue or TODO comment with a plan for gradually re-enabling these rules to prevent this allow list from becoming permanent technical debt.
|
tbh i dont really like this unless we are fixing the rules. otherwise this just adds a ton of filler to the top of the file for nothing |
I believe most of these rules would result in cleaner code if fixed - want me to try fixing some of them in this PR and you can see what you think? I can do one rule per commit for easy review. If not, feel free to close this, no worries! |
yeah that'd be great |
fa1c9d3 to
5d9538b
Compare
Done. I was able to turn about half of them off, and there are a few more that could be fixed with some broader refactoring (splitting up huge functions & structs) |
5d9538b to
2659ccb
Compare
2659ccb to
a4ab51a
Compare
|
overall looks good! some of these I don't really like tbh, can we revert
and then lgtm |
a4ab51a to
0a6aa51
Compare
Removed and ready for another round of review |
benthecarman
left a comment
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.
lgtm!
Enable nursery and pedantic rulesets for clippy, and disable all rules that currently get triggered. Then fix and enforce many of the rules one-by-one.
While not all of the clippy and pedantic rules are helpful, and some can produce false positives, many of them are fairly uncontroversial and help keep code clean. For example,
redundant_clone(<- nursery rule) andunnecessary_wraps(<- pedantic rule).