Preserve trailing statement semicolons when using fmt: skip (#8273)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
---
|
||||
source: crates/ruff_python_formatter/tests/fixtures.rs
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/trailing_semi.py
|
||||
---
|
||||
## Input
|
||||
```py
|
||||
x = 1; # fmt: skip
|
||||
|
||||
x = 1 ; # fmt: skip
|
||||
|
||||
x = 1 \
|
||||
; # fmt: skip
|
||||
|
||||
x = 1 # ; # fmt: skip
|
||||
|
||||
_; #unrelated semicolon
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
x = 1; # fmt: skip
|
||||
|
||||
x = 1 ; # fmt: skip
|
||||
|
||||
x = 1 \
|
||||
; # fmt: skip
|
||||
|
||||
x = 1 # ; # fmt: skip
|
||||
|
||||
_ # unrelated semicolon
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user