-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
# fmt: skip
ignored in fluent interface
#3364
Comments
I also have this issue (see #3443). What's the motivation that foo_dict.setdefault("a", {}) is put on the first line? I had a look on this page. I seems that the majority of languages use
instead of
In my point of view, the former formatting is by far more readable because I see the object and then its methods that are applied. Alternatively, one could also use
but I would still strongly prefer option 1. |
Please open a new issue if you want Black's normal formatting to change. This issue should be only about |
@JelleZijlstra You are right. My apologies. I have opened #3449. |
Say I'd like to format my code like so:
Black will of course reformat this to put
foo_dict.setdefault("a", {})
on the first line.Luckily, there are directives to not auto-format some lines:
Yet this doesn't work:
becomes:
Since the line
foo_dict # fmt: skip
ends with# fmt: skip
, I would expect black to leave it alone.Playground link
The text was updated successfully, but these errors were encountered: