mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Emit non-logical newlines for "empty" lines (#4444)
This commit is contained in:
parent
8134ec25f0
commit
f0465bf106
11 changed files with 54 additions and 161 deletions
|
@ -1,62 +0,0 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/src/lib.rs
|
||||
expression: snapshot
|
||||
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/comment_after_escaped_newline.py
|
||||
---
|
||||
## Input
|
||||
|
||||
```py
|
||||
def bob(): \
|
||||
# pylint: disable=W9016
|
||||
pass
|
||||
|
||||
|
||||
def bobtwo(): \
|
||||
\
|
||||
# some comment here
|
||||
pass
|
||||
```
|
||||
|
||||
## Black Differences
|
||||
|
||||
```diff
|
||||
--- Black
|
||||
+++ Ruff
|
||||
@@ -1,6 +1,8 @@
|
||||
-def bob(): # pylint: disable=W9016
|
||||
+def bob():
|
||||
+ # pylint: disable=W9016
|
||||
pass
|
||||
|
||||
|
||||
-def bobtwo(): # some comment here
|
||||
+def bobtwo():
|
||||
+ # some comment here
|
||||
pass
|
||||
```
|
||||
|
||||
## Ruff Output
|
||||
|
||||
```py
|
||||
def bob():
|
||||
# pylint: disable=W9016
|
||||
pass
|
||||
|
||||
|
||||
def bobtwo():
|
||||
# some comment here
|
||||
pass
|
||||
```
|
||||
|
||||
## Black Output
|
||||
|
||||
```py
|
||||
def bob(): # pylint: disable=W9016
|
||||
pass
|
||||
|
||||
|
||||
def bobtwo(): # some comment here
|
||||
pass
|
||||
```
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue