Preserve trailing statement semicolons when using fmt: skip (#8273)

This commit is contained in:
Micha Reiser 2023-10-30 09:07:14 +09:00 committed by GitHub
parent e799f90782
commit 2c84f911c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 3 deletions

View file

@ -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
```