Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 807 Bytes

File metadata and controls

29 lines (19 loc) · 807 Bytes

Pattern: Malformed indent for continuation line

Issue: -

Description

Continuation lines should not be indented at the same level as the next logical line. Instead, they should be indented to one more level so as to distinguish them from the next line.

Example of incorrect code:

In this example the second line is indented at the same level as the line below it. This makes it difficult to tell what is in the if block and what is a part of the boolean expression.

if user is not None and user.is_admin or \
    user.name == 'Grant':
    blah = 'yeahnah'

Example of correct code:

if user is not None and user.is_admin or \
        user.name == 'Grant':
    blah = 'yeahnah'

Further Reading