Skip to content

formatter deviation: line break not occurring on assignments where LHS goes over line-length #11820

Open
@jonathan-hill-visasq

Description

I'm seeing a case where black is expanding an assignment but ruff is not - even re-writing the black formatted result.

To keep it concise, this example uses an ultra-short line-length of 14:

Input

long_variable_name = 1234

Black:

long_variable_name = (
    1234
)

Ruff:

long_variable_name = 1234

This seems to occur only when the name of the variable assigned to, is longer than line-length (so expanding the line won't bring it within the allowed length).

I can't find this in the documented deviations or other issues at present, and this doesn't seem to be a duplicate of another issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formatterstyleHow should formatted code look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions