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

yapf --style=pep8 does not put spaces after a trailing comma #20

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

yapf --style=pep8 does not put spaces after a trailing comma #20

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

Comments

@DRMacIver
Copy link

Reformatting the following (pep8 correct) code:

trailing_comma = [
    1,
]

Results in the following:

trailing_comma = [1,]

PEP8 wants whitespace after the trailing comma. I can't immediately find a reference in PEP8 itself, but the pep8 checker program calls this E231.

@DRMacIver
Copy link
Author

Confirmed in master.

@eliben
Copy link
Member

eliben commented Mar 28, 2015

This is the first time I hear that PEP8 requires whitespace after a trailing comma. The reformatting done by yapf seems reasonable here, and adding a space after the comma would be ugly.

Note that we have an algorithm in the works that will keep data structures with trailing commas as a one-per-line, so this specific issue will likely go away.

bwendling added a commit that referenced this issue Mar 30, 2015
Add a knob to specify if we want a space between the ending comma and closting
bracket.

Closing #20
@bwendling bwendling added the bug label Mar 30, 2015
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

3 participants