Skip to content

Conversation

@dvandersluis
Copy link
Member

Updates Style/RedundantFormat to properly handle * as a width specifier when the width argument is not literal. Also updated to be able to handle * with a variable specifier (ie. %1$*2$s uses the 2nd argument as the width).

Fixes #14528.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

…g has a variable width that isn't given as a literal value
@koic koic merged commit 4f883f4 into rubocop:master Sep 17, 2025
22 checks passed
@dvandersluis dvandersluis deleted the issue/14528 branch September 17, 2025 17:49
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.

An error occurred while Style/RedundantFormat cop was inspecting

2 participants