Respect spacing around colons and assigments #8862
Answered
by
zanieb
nuno-andre
asked this question in
Q&A
-
Hi, everyone! I use to align types and some assignments as follows: @dataclass
class Example:
an_attr: int
another_attr: str | None
whatever: dict[str, str]
class Colors(IntEnum):
BLACK = 0
RED = 1
YELLOW = 2 I have searched the documentation and this repo, but I can't find a way to make ruff respect this spacing. Is there any way? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
zanieb
Nov 27, 2023
Replies: 1 comment 1 reply
-
Hi! Our formatter does not support this. There's a similar discussion about alignment of trailing comments at #7684 that you may find interesting. I'd recommend disabling formatting in these sections for now. There are also some previous discussions over on Black, which we are currently aiming for compatibility with: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
charliermarsh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! Our formatter does not support this. There's a similar discussion about alignment of trailing comments at #7684 that you may find interesting. I'd recommend disabling formatting in these sections for now.
There are also some previous discussions over on Black, which we are currently aiming for compatibility with: