Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Wrong Hanging Indentation" false positive? #232

Closed
pylint-bot opened this issue May 5, 2014 · 4 comments
Closed

"Wrong Hanging Indentation" false positive? #232

pylint-bot opened this issue May 5, 2014 · 4 comments
Labels

Comments

@pylint-bot
Copy link

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?


@pylint-bot
Copy link
Author

Original comment by Sean Wallitsch (BitBucket: shidarin, GitHub: @shidarin?):


I went ahead and created some sample code on a github gist.

@pylint-bot
Copy link
Author

Original comment by Steven Myint (BitBucket: myint, GitHub: @myint?):


More examples of okay style: https://github.com/jcrocholl/pep8/blob/master/testsuite/E12not.py

And examples of actual bad continuations: https://github.com/jcrocholl/pep8/blob/master/testsuite/E12.py

@pylint-bot
Copy link
Author

Original comment by Torsten Marek (BitBucket: tmarek, GitHub: @tmarek?):


This is fixed in e3ecc89.

@pylint-bot
Copy link
Author

Original comment by Steven Myint (BitBucket: myint, GitHub: @myint?):


Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant