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

E129 visually indented line with same indent as next logical line #33

Closed
DRMacIver opened this issue Mar 26, 2015 · 2 comments
Closed

Comments

@DRMacIver
Copy link

yapf formats:

def response():
    if (defined and
            dirs is _dirs_undefined and dictionary is _dictionary_undefined):
        return to

as

def response():
    if (defined and dirs is _dirs_undefined and
        dictionary is _dictionary_undefined):
        return to

pep8 checker gives E129. I also agree with it that this looks misleading.

pyformat thinks the original is correct and leaves it untouched. I would personally have formatted as

def response():
    if (
        defined and
        dirs is _dirs_undefined and dictionary is _dictionary_undefined
    ):
        return to

but I'm not wedded to that and suspect you like whitespace less than I do. :-)

@Nodd
Copy link

Nodd commented Apr 9, 2015

This is a duplicate of #21.
Also for your example I think that this is the most common usage:

def response():
    if (defined and dirs is _dirs_undefined and
            dictionary is _dictionary_undefined):
        return to

i.e. adding one more level of indentation than the block content. Same goes for elif ( even if the parenthesis indentation is already different than the block.

@bwendling
Copy link
Member

#21 is finished. I think this should work now.

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

No branches or pull requests

3 participants