Skip to content

Conversation

@tvolk131
Copy link
Contributor

@tvolk131 tvolk131 commented Aug 20, 2025

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) and unnecessary_wraps (<- pedantic rule).

Copilot AI review requested due to automatic review settings August 20, 2025 13:57
Copy link

Copilot AI left a 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::nursery and clippy::pedantic lints 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.

clippy::uninlined_format_args,
clippy::unreadable_literal,
clippy::unused_self,
clippy::use_self
Copy link

Copilot AI Aug 20, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
clippy::unnecessary_wraps,
clippy::unused_async,
clippy::use_self
)]
Copy link

Copilot AI Aug 20, 2025

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.

Copilot uses AI. Check for mistakes.
@benthecarman
Copy link
Contributor

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

@tvolk131
Copy link
Contributor Author

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!

@benthecarman
Copy link
Contributor

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

@tvolk131
Copy link
Contributor Author

yeah that'd be great

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)

@benthecarman
Copy link
Contributor

overall looks good! some of these I don't really like tbh, can we revert

single_match_else rule
redundant_closure_for_method_calls
manual_let_else
match_same_arms

and then lgtm

@tvolk131
Copy link
Contributor Author

overall looks good! some of these I don't really like tbh, can we revert

single_match_else rule redundant_closure_for_method_calls manual_let_else match_same_arms

and then lgtm

Removed and ready for another round of review

Copy link
Contributor

@benthecarman benthecarman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@benthecarman benthecarman merged commit b3fcbc3 into HarborWallet:master Sep 2, 2025
1 check passed
@tvolk131 tvolk131 deleted the annoying_clippy branch September 2, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants