Skip to content

Files

Latest commit

 

History

History
47 lines (32 loc) · 826 Bytes

File metadata and controls

47 lines (32 loc) · 826 Bytes

Pattern: Use of under-indented continuation line for hanging indent

Issue: -

Description

A line is less indented than it should be for hanging indents.

Example of incorrect code:

In the first example, the keys of this dict are only indented with 3 spaces. They should be indented with 4 spaces.

result = {
   'key1': 'value',
   'key2': 'value',
}

Example of correct code:

result = {
    'key1': 'value',
    'key2': 'value',
}

Example of incorrect code:

In this example, the second line is only indented with 2 spaces. It should be indented with 4 spaces.

print("Python", (
  "Rules"))

Example of correct code:

print("Python", (
    "Rules"))

Further Reading