Skip to content

fix_power_op_line_length preview style #8938

@MichaReiser

Description

@MichaReiser

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.

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatterpreviewRelated to preview mode features

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions