Skip to content

Files

Latest commit

 

History

History
30 lines (20 loc) · 680 Bytes

Style-FormatString.md

File metadata and controls

30 lines (20 loc) · 680 Bytes

Pattern: Inconsistent single string formatting

Issue: -

Description

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.

Examples

# bad
'%d %d' % [20, 10]
# => '20 10'

format('%d %d', 20, 10)
# => '20 10'

Default configuration

Attribute Value
EnforcedStyle format
SupportedStyles format, sprintf, percent

Further Reading