mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 05:13:00 +00:00
Fix handling of newlines in empty files (#7473)
This commit is contained in:
parent
b66bfa6570
commit
0346e781d4
12 changed files with 90 additions and 15 deletions
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/tests/fixtures.rs
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_multiple_trailing_newlines.py
|
||||
---
|
||||
## Input
|
||||
```py
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/tests/fixtures.rs
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_now_newline.py
|
||||
---
|
||||
## Input
|
||||
```py
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/tests/fixtures.rs
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_trailing_newline.py
|
||||
---
|
||||
## Input
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/tests/fixtures.rs
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/empty_whitespace.py
|
||||
---
|
||||
## Input
|
||||
```py
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -17,7 +17,6 @@ magic-trailing-comma = Respect
|
|||
```
|
||||
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -31,7 +30,6 @@ magic-trailing-comma = Respect
|
|||
```
|
||||
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -45,7 +43,6 @@ magic-trailing-comma = Respect
|
|||
```
|
||||
|
||||
```py
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue