-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow fmt: skip with interspersed same-line comments
- Loading branch information
1 parent
4b8b3a1
commit 319df66
Showing
4 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/reason.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Supported | ||
x = 1 # fmt: skip | ||
x = 1 # fmt: skip # reason | ||
x = 1 # reason # fmt: skip | ||
|
||
# Unsupported | ||
x = 1 # fmt: skip reason | ||
x = 1 # fmt: skip - reason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/ruff_python_formatter/tests/snapshots/format@fmt_skip__reason.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: crates/ruff_python_formatter/tests/fixtures.rs | ||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/reason.py | ||
--- | ||
## Input | ||
```python | ||
# Supported | ||
x = 1 # fmt: skip | ||
x = 1 # fmt: skip # reason | ||
x = 1 # reason # fmt: skip | ||
# Unsupported | ||
x = 1 # fmt: skip reason | ||
x = 1 # fmt: skip - reason | ||
``` | ||
|
||
## Output | ||
```python | ||
# Supported | ||
x = 1 # fmt: skip | ||
x = 1 # fmt: skip # reason | ||
x = 1 # reason # fmt: skip | ||
# Unsupported | ||
x = 1 # fmt: skip reason | ||
x = 1 # fmt: skip - reason | ||
``` | ||
|
||
|
||
|