Don't break lines with inline comment? #20688
Answered
by
ntBre
Lucianod28
asked this question in
Q&A
-
Is there a way to prevent ruff from breaking lines that are over the length limit because of an inline comment? For example: if some_check or other1 or other2 or other3: # inline comment that makes the line exceed 100 characters becomes if (
some_check or other1 or other2 or other3
): # inline comment that makes the line exceed 100 characters I would prefer for it to be # inline comment that makes the line exceed 100 characters
if some_check or other1 or other2 or other3: I assume that's not possible, but is there a way to configure Ruff to simply not break long lines containing inline comments? I wouldn't mind manually breaking the line in that case, just like when you have a comment that's too long. |
Beta Was this translation helpful? Give feedback.
Answered by
ntBre
Oct 3, 2025
Replies: 1 comment 1 reply
-
I don't believe there's an existing option for this. There's a recent related issue in #20641, albeit for a more specific use case. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Lucianod28
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't believe there's an existing option for this. There's a recent related issue in #20641, albeit for a more specific use case.