Skip to content

"Wrong Hanging Indentation" false positive? #232

Closed
@pylint-bot

Description

@pylint-bot

Originally reported by: Sean Wallitsch (BitBucket: shidarin, GitHub: @shidarin?)


Since 1.2.1, pylint no longer lets the following be an acceptable line continuation:

#!python
    parser.add_argument(
        "-o",
        "--output",
        help="specify the filetype to convert to, comma separated lists are "
             "accepted. Defaults to a .cc XML. Supported output formats are: "
             "{outputs}".format(outputs=str(OUTPUT_FORMATS.keys()))
    )

It's throwing C0330(bad-continuation) with the note "Wrong Hanging indentation." Seeming to prefer the following:

#!python
    parser.add_argument(
        "-o",
        "--output",
        help="specify the filetype to convert to, comma separated lists are "
        "accepted. Defaults to a .cc XML. Supported output formats are: "
        "{outputs}".format(outputs=str(OUTPUT_FORMATS.keys()))
    )

Which doesn't seem right. This looks like it was introduced in this commit, and we noticed it when the new version was being used on landscape.io (see github issue here). Is this a bug?


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