Alex
Alex

Reputation: 19124

How can I customize code formatting in PyCharm?

Is it possible to do arbitrary code formatting in PyCharm? I am trying to create separate lines for each parameter with a comma after the last parameter. E.g.

def f(x, y):
    pass

to

def f(
    x,
    y,
):
    pass

I am also interested in a more general solution. The closest I found is EditorConfig, but that is mostly for code spacing rules.

Upvotes: 2

Views: 196

Answers (1)

Sergey K.
Sergey K.

Reputation: 2023

This isn't achievable at the moment. There are various feature requests about code formatting (like https://youtrack.jetbrains.com/issue/PY-22986), but feel free to submit another one for your needs.

Upvotes: 2

Related Questions