-
Notifications
You must be signed in to change notification settings - Fork 896
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
Add parentheisis and prefer splitting on long function chaining #214
Comments
Any updates on this? Sorry for bumping! |
Started using yapf a couple of weeks ago, loving it so far but I'd love it even more if there was a knob for that. If there is demand and somebody could point me to the right direction, I can give it a try. |
a similar place that could use parens:
currently that formats to this oddity:
if the author adds the parens manually, it produces visually desirable code. |
You could always use "Black" (see #794) to make those changes and then running yapf to get the formatting in the style you want. ;) Yapf has a policy of making only white-space changes to code and not inserting or deleting parentheses. In the README:
|
Often when chaining functions, e.g. long queries/maps/reduce, it's easy to get ugly code... see for example this SO question!
I think the preferred formatting is to insert parenthesis:
Indeed, even if you have already inserted the paren as above yapf "fixes" to:
*Note: I suspect this is pretty speculative :)
The text was updated successfully, but these errors were encountered: