We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See #8436 for background.
Stable formatting of dicts with a long value results in a wrap that reduces readability
Unformatted:
if True: ___ = { "x": "---", "y": "--------------------------------------------------------------" if True else None, "z": "---", }
Formatted (Ruff, Black stable):
Formatted (Black preview):
if True: ___ = { "x": "---", "y": ( "--------------------------------------------------------------" if True else None ), "z": "---", }
With a shorter line, Ruff retains parenthesis when the lines are collapsed:
if True: ___ = { "x": "---", "y": ("----------------------------------------------------" if True else None), "z": "---", }
However, these parenthesis should be removed as they are superfluous.
Black's preview style will remove these parenthesis:
if True: ___ = { "x": "---", "y": "----------------------------------------------------" if True else None, "z": "---", }
See psf/black#620 psf/black#3440
Note that Black does not remove these parenthesis for calls or lists, see #8436 and #8438
The text was updated successfully, but these errors were encountered:
parenthesize_conditional_expressions
I merged this into #8438 and create a new issue for parenthesizing long values.
Sorry, something went wrong.
No branches or pull requests
See #8436 for background.
Stable formatting of dicts with a long value results in a wrap that reduces readability
Unformatted:
Formatted (Ruff, Black stable):
Formatted (Black preview):
With a shorter line, Ruff retains parenthesis when the lines are collapsed:
However, these parenthesis should be removed as they are superfluous.
Black's preview style will remove these parenthesis:
See psf/black#620 psf/black#3440
Note that Black does not remove these parenthesis for calls or lists, see #8436 and #8438
The text was updated successfully, but these errors were encountered: