Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 760 Bytes

File metadata and controls

29 lines (19 loc) · 760 Bytes

Pattern: Visually indented line with same indent as next logical line

Issue: -

Description

A visual indented line has the same indentation as the next logical line. This can make it hard to read.

Example of incorrect code:

In this example the second line is indented at the same level as the body of the if statement.

if (row < 0 or module_count <= row or
    col < 0 or module_count <= col):
    raise Exception("%s,%s - %s" % (row, col, self.moduleCount))

Example of correct code:

if (row < 0 or module_count <= row or
        col < 0 or module_count <= col):
    raise Exception("%s,%s - %s" % (row, col, self.moduleCount))

Further Reading