Skip to content

Conversation

@syjn99
Copy link
Member

@syjn99 syjn99 commented Sep 23, 2025

What was wrong?

Our PR reviews often contain this kind of comment, let Clippy handle it.

How was it fixed?

Rationale

  • let_and_return (Link): Few cases for assigning variables before returning.
  • uninlined_format_args (Link): Inline arguments as possible as we can. Note that this rule couldn't detect macros from tracing.
  • unnecessary_debug_formatting (Link): Use path.display() for printing the file path.
  • unwrap_used (Link): Stop using unwrap() for production code, use expect() instead.
  • useless_let_if_seq (Link): I think this style is better :)
  • wildcard_imports (Link): This rule reminds me of this comment, which is reasonable.

Side note

I guess needless_pass_by_value (Link) can be helpful and is often a topic for our PR comments, but this leads so many LOC to satisfy the linter. I'd like the team to share opinions on it.

To-Do

@syjn99 syjn99 marked this pull request as ready for review September 23, 2025 23:28
Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

Can you add a CI to ensure we don't forget to add lints.workspace = true in the future, we should be able to use this https://crates.io/crates/cargo-workspace-lints ?

@syjn99 syjn99 marked this pull request as draft September 24, 2025 05:58
@syjn99
Copy link
Member Author

syjn99 commented Sep 24, 2025

Converting to draft as I'm adding more rules.

@syjn99 syjn99 changed the title chore: add clippy rule(uninlined_format_args) chore/ci: add clippy rules for codebase consistency Sep 24, 2025
@syjn99 syjn99 changed the title chore/ci: add clippy rules for codebase consistency chore: add clippy rules for codebase consistency Sep 24, 2025
@syjn99 syjn99 requested a review from KolbyML September 24, 2025 06:44
@syjn99 syjn99 marked this pull request as ready for review September 24, 2025 06:44
@jihoonsong
Copy link
Contributor

This is very nice. This doesn't have to be perfect imo. Once this change is in place, if it feels like over 80 out of 100 to us, that’s good; if it feels over 90, that’s awesome.

Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: looks good, we should use needless_pass_by_value

@KolbyML
Copy link
Contributor

KolbyML commented Sep 24, 2025

actually there is a few cases were it wouldn't make sense and I am not sure if the linter is able to pick that up or not so, never mind

@KolbyML KolbyML added this pull request to the merge queue Sep 24, 2025
Merged via the queue into ReamLabs:master with commit 0d1a527 Sep 24, 2025
15 checks passed
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.

4 participants