I'm using ruff
(https://docs.astral.sh/ruff/). Is it possible to format the code from this:
__all__ = ["Model", "User", "Account"]
Into this?
__all__ = [
"Model",
"User",
"Account"
]
I'm using ruff
(https://docs.astral.sh/ruff/). Is it possible to format the code from this:
__all__ = ["Model", "User", "Account"]
Into this?
__all__ = [
"Model",
"User",
"Account"
]
So I found the answer.
ruff
has amazing feature calledmagic-trailing-comma
. If you want your list, no matter how long is it, to be one line just don't put comma after the last element:In case you want your function args or list elements to be one per line just put a magic trailing comma after the last element: