
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
14 lines
235 B
Python
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
|