Skip to content
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

fix clippy warnings: this looks like a formatting argument but it is not part of a formatting macro #1041

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

0x53A
Copy link
Contributor

@0x53A 0x53A commented Feb 9, 2025

With my version of clippy clippy 0.1.86 (99768c80a1 2025-01-23) (probably newer than CI build?) I'm getting two warnings on current master:

warning: this looks like a formatting argument but it is not part of a formatting macro
  --> itest/rust/src/builtin_tests/geometry/quaternion_test.rs:44:35
   |
44 |     expect_panic("Quaternion axis {axis:?} is not normalized.", || {
   |                                   ^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args
   = note: `#[warn(clippy::literal_string_with_formatting_args)]` on by default

warning: this looks like a formatting argument but it is not part of a formatting macro
  --> itest/rust/src/builtin_tests/geometry/quaternion_test.rs:48:35
   |
48 |     expect_panic("Quaternion axis {axis:?} is not normalized.", || {
   |                                   ^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

The warnings are correct, expect_panic is a function (not a macro) that takes a string argument:

image

Edit:

yep the warning was added with v1.85: https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

Edit2: hmm it's part of the "nursery" group so should be disabled by default, do feel free to just close this PR if it's not applicable.

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1041

@0x53A 0x53A force-pushed the fix-clippy-format branch 2 times, most recently from 0e195c4 to a708148 Compare February 9, 2025 19:13
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

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

Thanks, good catch!

The clippy lints are applicable, however I think it's better to adjust the string literal to include the values verbatim, than formatting them (see example). Could you change this?

itest/rust/src/builtin_tests/geometry/quaternion_test.rs Outdated Show resolved Hide resolved
@Bromeon Bromeon added the bug label Feb 9, 2025
@0x53A 0x53A force-pushed the fix-clippy-format branch from a708148 to 725a7e5 Compare February 10, 2025 22:11
@0x53A 0x53A force-pushed the fix-clippy-format branch from 725a7e5 to 8fd043c Compare February 10, 2025 22:13
@0x53A
Copy link
Contributor Author

0x53A commented Feb 10, 2025

done

@Bromeon Bromeon added the c: tooling CI, automation, tools label Feb 10, 2025
@Bromeon Bromeon added this pull request to the merge queue Feb 10, 2025
@Bromeon
Copy link
Member

Bromeon commented Feb 10, 2025

Thank you!

Merged via the queue into godot-rust:master with commit 187a289 Feb 10, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: tooling CI, automation, tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants