Closed
Description
Ruff adds unnecessary parentheses around return type annotations that are either:
- guaranteed to break like multiline strings
- Come with their own set of parentheses
def test() -> """test
""": pass
def test() -> [aaa, bbbb,]: pass
def test() -> lists(a, b,): pass
Ruff
def test() -> (
"""test
"""
):
pass
def test() -> ([
aaa,
bbbb,
]):
pass
def test() -> (
lists(
a,
b,
)
):
pass
Black
def test() -> """test
""":
pass
def test() -> [
aaa,
bbbb,
]:
pass
def test() -> lists(
a,
b,
):
pass