Skip to content

Conversation

Bisaloo
Copy link
Collaborator

@Bisaloo Bisaloo commented Jul 26, 2025

Covers some cases from #2183.

As opposed to what seemed implied in some of the comments, I went with treating the constant strings case before checking if the call is invalid to make the maximum possible as static analysis before evaluating calls.

constant_fmt_lint <- xml_nodes_to_lints(
sprintf_calls[constant_fmt],
source_expression = source_expression,
lint_message = "A constant string is used and the sprintf call can be removed",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This message should be improved to use the actual function, which can be gettextf, rather than sprintf.

@Bisaloo Bisaloo force-pushed the constant-strings branch from 3a5ab38 to 9e18825 Compare July 26, 2025 18:16
@Bisaloo Bisaloo force-pushed the constant-strings branch from 9e18825 to 85ce180 Compare July 26, 2025 18:17
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@38db1ac). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2894   +/-   ##
=======================================
  Coverage        ?   99.27%           
=======================================
  Files           ?      128           
  Lines           ?     7222           
  Branches        ?        0           
=======================================
  Hits            ?     7170           
  Misses          ?       52           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

I think it's ready to go, just another round of small tweaks requested. Thanks!

Copy link
Collaborator

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@MichaelChirico MichaelChirico merged commit 8783914 into main Jul 28, 2025
21 checks passed
@MichaelChirico MichaelChirico deleted the constant-strings branch July 28, 2025 16:43
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