Pattern: Inconsistent single string formatting
Issue: -
This rule enforces the use of a single string formatting utility. By default, it favor's the use of format
over the fairly cryptic String#%
method.
# bad
'%d %d' % [20, 10]
# => '20 10'
format('%d %d', 20, 10)
# => '20 10'
Attribute | Value |
---|---|
EnforcedStyle | format |
SupportedStyles | format, sprintf, percent |