Skip to content

Files

Latest commit

 

History

History
24 lines (16 loc) · 584 Bytes

Lint-NestedPercentLiteral.md

File metadata and controls

24 lines (16 loc) · 584 Bytes

Pattern: Nested percent literal

Issue: -

Description

Within percent literals, nested percent literals do not function and may be unwanted in the result.

Examples

# bad

# The percent literal for nested_attributes is parsed as four tokens,
# yielding the array [:name, :content, :"%i[incorrectly", :"nested]"].
attributes = {
  valid_attributes: %i[name content],
  nested_attributes: %i[name content %i[incorrectly nested]]
}

Further Reading