mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 18:02:58 +00:00
Support fmt: skip
for simple-statements and decorators (#6561)
This commit is contained in:
parent
e3ecbe660e
commit
4dc32a00d0
40 changed files with 545 additions and 316 deletions
19
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/decorators.py
vendored
Normal file
19
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/decorators.py
vendored
Normal file
|
@ -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
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/docstrings.py
vendored
Normal file
13
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_skip/docstrings.py
vendored
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue