Skip to content

Files

Latest commit

 

History

History
19 lines (12 loc) · 666 Bytes

ClosureStatementOnOpeningLineOfMultipleLineClosure.md

File metadata and controls

19 lines (12 loc) · 666 Bytes

Pattern: Closure statement on opening line of multiple line closure

Issue: -

Description

Checks for closure logic on first line (after ->) for a multi-line closure. That breaks the symmetry of indentation (if the subsequent statements are indented normally), and that first statement can be easily missed when reading the code.

Example of violations:

def closure = { name -> println name
    addToCounts()
    println “done” }

Further Reading