-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
fmt: skip
on statement and decorator level
- Loading branch information
1 parent
df98068
commit 8731120
Showing
17 changed files
with
366 additions
and
277 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/decorators.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,19 @@ | ||
|
||
@FormattedDecorator(a =b) | ||
# leading comment | ||
@MyDecorator( # dangling comment | ||
list = [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12], x = some_other_function_call({ "test": "value", "more": "other"})) # fmt: skip | ||
# leading class comment | ||
class Test: | ||
pass | ||
|
||
|
||
|
||
@FormattedDecorator(a =b) | ||
# leading comment | ||
@MyDecorator( # dangling comment | ||
list = [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12], x = some_other_function_call({ "test": "value", "more": "other"})) # fmt: skip | ||
# leading class comment | ||
def test(): | ||
pass | ||
|
13 changes: 13 additions & 0 deletions
13
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/docstrings.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,13 @@ | ||
def test(): | ||
# leading comment | ||
""" This docstring does not | ||
get formatted | ||
""" # fmt: skip | ||
# trailing comment | ||
|
||
def test(): | ||
# leading comment | ||
""" This docstring gets formatted | ||
""" # trailing comment | ||
|
||
and_this + gets + formatted + too |
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
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
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
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
Oops, something went wrong.