mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 02:12:22 +00:00
Preserve trailing statement semicolons when using fmt: skip
(#8273)
This commit is contained in:
parent
e799f90782
commit
2c84f911c4
5 changed files with 85 additions and 3 deletions
|
@ -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
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue