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

Black produced different code on the second pass, moving a comment #3706

Closed
DRMacIver opened this issue May 25, 2023 · 1 comment
Closed
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working

Comments

@DRMacIver
Copy link

DRMacIver commented May 25, 2023

Running black 23.3.0 on the following code:

class S:
 if():last_shard.accumulated_answer_json_size_bytes=(#pylint: disable=invalid-name
[0])

Produces the following output:

class S:
    if ():
        last_shard.accumulated_answer_json_size_bytes = (
            [0]  # pylint: disable=invalid-name
        )

But if we run black on it again we get the following:

class S:
    if ():
        last_shard.accumulated_answer_json_size_bytes = [
            0
        ]  # pylint: disable=invalid-name

(Running black a third time makes no changes)

This should probably produce the final answer immediately when run on the initial code, but either way black presumably shouldn't reformat its own output.

Edit to add: Sorry, this is probably a dupe of #3701. When I was initially looking at it, I thought this seemed more distinct than it now looks like it does. There are some slight differences so it might not be, but more likely than not it's the same underlying issue.

@DRMacIver DRMacIver added the T: bug Something isn't working label May 25, 2023
@JelleZijlstra JelleZijlstra added the C: unstable formatting Formatting changed on the second pass label May 26, 2023
@JelleZijlstra
Copy link
Collaborator

Agree this looks the same as #3701.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants