Skip to content

Files

Latest commit

 

History

History
112 lines (70 loc) · 875 Bytes

vertical_whitespace_closing_braces.md

File metadata and controls

112 lines (70 loc) · 875 Bytes

Pattern: Malformed whitespace before closing braces

Issue: -

Description

Don't include vertical whitespace (empty line) before closing braces.

Examples of correct code:

        )
}
    }
}


    print("x is 5")
}


    print("x is 5")
}


    print("x is 5")
}


/*
    class X {

        let x = 5

    }
*/


[
1,
2,
3
]


[1, 2].map { $0 }.filter {


[1, 2].map { $0 }.filter { num in


class Name {
    run(5) { x in print(x) }
}


foo(
x: 5,
y:6
)

Examples of incorrect code:

        )
}

    }
}


    print("x is 5")


}


    print("x is 5")

}


    print("x is 5")
    
}


[
1,
2,
3

]


class Name {
    run(5) { x in print(x) }

}


foo(
x: 5,
y:6

)

Further Reading