-
Notifications
You must be signed in to change notification settings - Fork 753
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
E231: Check misses trailing comma in function or class calls that do not end with whitespace #980
Comments
pycodestyle is an old tool and pep8 changes a lot so they're not always in sync (and even when they could be, sometimes pep8 has flip-flopped on an issue or is directly contradictory with itself so it's impossible to follow to a T). this particular part of pep8 is relatively new (2017) and so it's not surprising that pycodestyle has nothing for it. additionally it's tricky to get correct, in your example you might be interested in some tools which are built around handling these such as add-trailing-comma or black -- both of which are probably better suited to handle this than pycodestyle is |
Thanks for the reply and also for the hints towards the plugin. I'll have a look. Ironically, I was stumbling over this while using flake8, which, I am assuming, uses pycodestyle, in conjunction with black (which produces these kind of lines under certain circumstances, at least for the version I am using. But that does not belong here.). |
I am not sure I understand your remark about |
consider |
I see, thanks. |
Trailing commas in function calls, e.g.
print(1,2,)
that do not end with a white space are not flagged by pycodestyle.From reading the corresponding PEP8 I would expect that pycodestyle would flag this.
Here's a small example:
Although this is valid python code I'd expect pycodestyle to flag all of the three last lines, but it doesn't.
Is this behaviour expected?
Environment:
The text was updated successfully, but these errors were encountered: