Feature request: Respect # fmt: skip
at the end of multi-line statements
#3009
Labels
# fmt: skip
at the end of multi-line statements
#3009
Is your feature request related to a problem? Please describe.
Consider the following un-blackened code:
Applying black to this code produces an output that I'd argue is strictly worse than the input:
It's unclear to me whether this constitutes a bug in black, but regardless I'd expect to be able to disable black on this one statement by writing
# fmt: skip
as follows:This does not seem to work — the line is wrapped exactly as before.
Describe the solution you'd like
Python statements whose final line is marked with
# fmt: skip
should not be reformatted even if the statement spans across multiple lines.Describe alternatives you've considered
My current workaround is to use
# fmt: off
and# fmt: on
, but this is suboptimal as it adds exactly as many lines as it saves, except when there are multiple consecutive statements affected.Additional context
I'm using conda-installed black 21.12b0 on MacOS Big Sur 11.6.
The text was updated successfully, but these errors were encountered: