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

Long calculation statement with function #2587

Closed
Vincent0706 opened this issue Nov 4, 2021 · 1 comment
Closed

Long calculation statement with function #2587

Vincent0706 opened this issue Nov 4, 2021 · 1 comment
Labels
R: duplicate This issue or pull request already exists R: rejected This will not be worked on T: style What do we want Blackened code to look like?

Comments

@Vincent0706
Copy link

Describe the style change

Examples in the current Black style

len_x1y1 = math.pow(rec_po[0].x - rec_po[1].x, 2) + math.pow(
        rec_po[0].y - rec_po[1].y, 2
    )

Desired style

len_x1y1 = math.pow(rec_po[0].x - rec_po[1].x, 2) + math.pow(rec_po[0].y - rec_po[1].y, 2)
# or
len_x1y1 = ( math.pow(rec_po[0].x - rec_po[1].x, 2) 
             +math.pow(rec_po[0].y - rec_po[1].y, 2))

Additional context

@Vincent0706 Vincent0706 added the T: style What do we want Blackened code to look like? label Nov 4, 2021
@felix-hilden felix-hilden added R: duplicate This issue or pull request already exists R: rejected This will not be worked on labels Nov 4, 2021
@felix-hilden
Copy link
Collaborator

felix-hilden commented Nov 4, 2021

Hi, we'll not be supporting the latter style, because items on separate lines indented with one level are preferred. The first case would be produced if the line was short enough to fit one line. I do agree that exploding the parens here is the wrong option, and that is being discussed in #2156 and the various linked issues. I'll close this and let's continue discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists R: rejected This will not be worked on T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

2 participants