Skip to content

Files

Latest commit

 

History

History
35 lines (23 loc) · 639 Bytes

Layout-RedundantLineBreak.md

File metadata and controls

35 lines (23 loc) · 639 Bytes

Pattern: Redundant line break

Issue: -

Description

Checks whether certain expressions, e.g. method calls, that could fit completely on a single line, are broken up into multiple lines unnecessarily.

Examples

# bad
foo(
  a,
  b
)

puts 'string that fits on ' \
     'a single line'

things
  .select { |thing| thing.cond? }
  .join('-')

# good
foo(a, b)

puts 'string that fits on a single line'

things.select { |thing| thing.cond? }.join('-')

Further Reading