Is there a rule that always forces single line dictionaries? #13447
-
Like, I don't want this: {
"potato": "value",
"key": "value",
} I always want this: {"potato": "value", "key": "value"} Is there a rule for this? |
Beta Was this translation helpful? Give feedback.
Answered by
MichaReiser
Sep 22, 2024
Replies: 1 comment 1 reply
-
No, I don't think such rule exists. You can get this result when using |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, I don't think such rule exists. You can get this result when using
ruff format
(be warned, it applies many other formatting rules as well) when settingskip-magic-trailing-comma=true
. But only if you're okay if it splits the dictionary over multiple lines if it exceeds the configured line length