Skip to content

'Wrong hanging indent before block' False positive #2944

@cysabi

Description

@cysabi

Steps to reproduce

  1. ensure you are using 4 spaces for indent character
  2. paste this code:
for name, index in zip(
    [
        "foo:",
        "bar:",
    ],
    range(5),
):
    pass
  1. It will say there should be an extra 2 spaces in places it should not.

Current behavior

warnings

Expected behavior

No warnings

pylint --version output

pylint 2.3.1
astroid 2.2.5
Python 3.7.3 (default, May 11 2019, 00:38:04) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions