Skip to content
New issue

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

fix_power_op_line_length preview style #8938

Closed
Tracked by #8678
MichaReiser opened this issue Dec 1, 2023 · 0 comments · Fixed by #8947
Closed
Tracked by #8678

fix_power_op_line_length preview style #8938

MichaReiser opened this issue Dec 1, 2023 · 0 comments · Fixed by #8947
Assignees
Labels
formatter Related to the formatter preview Related to preview mode features

Comments

@MichaReiser
Copy link
Member

MichaReiser commented Dec 1, 2023

Implement Black's fix_power_op_line_length style as a preview style in Ruff.

b = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1

Should be formatted to

b = (
    1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
    ** 1
)

Notice the whitespace around the power op which we currently omit. This likely requires using if_group_breaks to only show the whitespace when the group breaks.

@MichaReiser MichaReiser changed the title fix_power_op_line_length fix_power_op_line_length preview style Dec 1, 2023
@MichaReiser MichaReiser added formatter Related to the formatter preview Related to preview mode features labels Dec 1, 2023
@MichaReiser MichaReiser added this to the Formatter: Stable milestone Dec 1, 2023
@MichaReiser MichaReiser self-assigned this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter preview Related to preview mode features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant