Skip to content

Add clippy rule to deny uninlined-format-args#7826

Merged
steviez merged 6 commits intoanza-xyz:masterfrom
steviez:enforce_clippy_uninlined-format-args
Sep 3, 2025
Merged

Add clippy rule to deny uninlined-format-args#7826
steviez merged 6 commits intoanza-xyz:masterfrom
steviez:enforce_clippy_uninlined-format-args

Conversation

@steviez
Copy link
Copy Markdown

@steviez steviez commented Sep 2, 2025

Problem

This lint is on by default in >= Rust 1.88.0. We are currently unable to upgrade Rust version due to an unrelated issue

Summary of Changes

Add the lint to keep our code compliant and ready to upgrade once we can do so

This PR was originally opened with items that are non-compliant to observe CI failures. Once #7825 merges and this PR is rebased, CI should complete without issue

Referenced PR merged + this PR rebased

@steviez
Copy link
Copy Markdown
Author

steviez commented Sep 2, 2025

As expected, some CI failures with the non-rebased PR:


error: variables can be used directly in the `format!` string
--
   --> io-uring/src/lib.rs:31:21
   |
31 |                     log::info!("io_uring NOT supported: {}", e);
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: requested on the command line with `-D clippy::uninlined-format-args`
   help: change this to
   |
31 -                     log::info!("io_uring NOT supported: {}", e);
31 +                     log::info!("io_uring NOT supported: {e}");
   |
    
   error: could not compile `agave-io-uring` (lib) due to 1 previous error

@steviez steviez force-pushed the enforce_clippy_uninlined-format-args branch from d6ca32f to 8df6bb1 Compare September 2, 2025 19:03
@steviez steviez requested review from a team as code owners September 2, 2025 21:44
This lint is on by default in >= Rust 1.88.0. We are currently unable to
upgrade Rust version due to an unrelated issue, but add the lint to keep
our code compliant and ready to upgrade once we can do so
@steviez steviez force-pushed the enforce_clippy_uninlined-format-args branch from fbe5278 to 1f4d722 Compare September 3, 2025 03:21
I think I missed this because they were in benches or other code that is
not "production". I also missed some in linux code since I'm running on
my Macbook
@steviez steviez force-pushed the enforce_clippy_uninlined-format-args branch from 1f4d722 to 929c26a Compare September 3, 2025 03:30
@steviez
Copy link
Copy Markdown
Author

steviez commented Sep 3, 2025

Reviewers - apologies for all the noise / pushes here. I ended up encountering instances in Linux, Solana, non-Unix and Windows target specific code which were not getting picked up when I was running on my Macbook.

I'm going to bed but looks like I'll have finally gotten CI passing. I'd also be open to breaking this PR up into one PR for all the source changes, and another for the addition of the lint; lemme know what y'all think

@steviez steviez force-pushed the enforce_clippy_uninlined-format-args branch from 398f8f1 to d392bbf Compare September 3, 2025 05:26
@steviez steviez requested a review from brooksprumo September 3, 2025 06:09
Copy link
Copy Markdown

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

This LGTM, it is not particularly huge and does not have functional changes anyway.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.0%. Comparing base (2933846) to head (d392bbf).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7826   +/-   ##
=======================================
  Coverage    83.0%    83.0%           
=======================================
  Files         809      809           
  Lines      356483   356483           
=======================================
+ Hits       296203   296221   +18     
+ Misses      60280    60262   -18     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

--deny=clippy::default_trait_access \
--deny=clippy::arithmetic_side_effects \
--deny=clippy::manual_let_else \
--deny=clippy::uninlined-format-args \
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎉

@steviez steviez merged commit cd6d2cd into anza-xyz:master Sep 3, 2025
44 checks passed
@steviez steviez deleted the enforce_clippy_uninlined-format-args branch September 3, 2025 17:14
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.

5 participants