Skip to content

Commit b79b73d

Browse files
committed
Add tests
1 parent 4bed0d5 commit b79b73d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/decorators.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@ class Test:
1717
def test():
1818
pass
1919

20+
21+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
22+
@decorator1
23+
@decorator2
24+
class Foo: # fmt: skip
25+
pass
26+
27+
28+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
29+
@decorator1
30+
@decorator2
31+
def foo(): # fmt: skip
32+
pass

crates/ruff_python_formatter/tests/snapshots/format@fmt_skip__decorators.py.snap

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ class Test:
2323
def test():
2424
pass
2525
26+
27+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
28+
@decorator1
29+
@decorator2
30+
class Foo: # fmt: skip
31+
pass
32+
33+
34+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
35+
@decorator1
36+
@decorator2
37+
def foo(): # fmt: skip
38+
pass
2639
```
2740

2841
## Output
@@ -43,6 +56,20 @@ class Test:
4356
# leading class comment
4457
def test():
4558
pass
59+
60+
61+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
62+
@decorator1
63+
@decorator2
64+
class Foo: # fmt: skip
65+
pass
66+
67+
68+
# Regression test for https://github.com/astral-sh/ruff/issues/7735
69+
@decorator1
70+
@decorator2
71+
def foo(): # fmt: skip
72+
pass
4673
```
4774

4875

0 commit comments

Comments
 (0)