black/tests/data/fmtskip6.py
Sergey Vartanov 40fae18134
Possible fix for issue with indentation and fmt: skip (#2281)
Not sure the fix is right.  Here is what I found: issue is connected
with line

    first.prefix = prefix[comment.consumed :]

in `comments.py`.  `first.prefix` is a prefix of the line, that ends
with `# fmt: skip`, but `comment.consumed` is the length of the
`"  # fmt: skip"` string.  If prefix length is greater than 14,
`first.prefix` will grow every time we apply formatting.

Fixes #2254
2021-06-08 14:37:34 -07:00

14 lines
235 B
Python

class A:
def f(self):
for line in range(10):
if True:
pass # fmt: skip
# output
class A:
def f(self):
for line in range(10):
if True:
pass # fmt: skip