-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Steps to reproduce the problem
%w[you sunshine].each do
puts format '(%16s)', "Hello #{it}" # Style/RedundantFormat
print format "(%16s)\n", "Hello #{it}" # Style/RedundantFormat
printf "(%16s)\n", "Hello #{it}" # Identical, but no cop
puts "( Hello #{it})" # Suggestion, different
puts
endExpected behavior
Not being pulled over.
Actual behavior
( Hello you)
( Hello you)
( Hello you)
( Hello you)
( Hello sunshine)
( Hello sunshine)
( Hello sunshine)
( Hello sunshine)
-:2:9: C: [Correctable] Style/RedundantFormat: Use "( Hello #{it})" directly instead of format.
puts format '(%16s)', "Hello #{it}" # Style/RedundantFormat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-:3:9: C: [Correctable] Style/RedundantFormat: Use "( Hello #{it})
" directly instead of format.
print format "(%16s)\n", "Hello #{it}" # Style/RedundantFormat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Side issue: Control characters should appear as originally written (\n in this instance)
RuboCop version
ruby 2025-08-01 30a20bc16
rubocop 2025-10-15 473598c90
System Version: macOS 15.6 (24G84)
Model Identifier: MacBookAir10,1