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

failure to reformat multiline dict with inline comments in a reasonable manner #800

Closed
bhearsum opened this issue Apr 10, 2019 · 3 comments
Labels
F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. T: style What do we want Blackened code to look like?

Comments

@bhearsum
Copy link

Operating system: Linux
Python version: 3.7.3
Black version: 19.3b0
Does also happen on master: ✔️

Code before:

    SYSLOG_LEVEL_MAP = {
        50: 2,  # CRITICAL
        40: 3,  # ERROR
        30: 4,  # WARNING
        20: 6,  # INFO
        10: 7,  # DEBUG
}

After:

SYSLOG_LEVEL_MAP = {50: 2, 40: 3, 30: 4, 20: 6, 10: 7}  # CRITICAL  # ERROR  # WARNING  # INFO  # DEBUG

Formatting works correctly with both a shorter line length, and trimming the dictionary to be less than 88 characters. (In those cases, Black doesn't do anything do the code.)

@bhearsum
Copy link
Author

Possibly similar or related to #379?

@JelleZijlstra JelleZijlstra added the F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. label May 5, 2019
@JelleZijlstra
Copy link
Collaborator

#826 would fix this.

@zsol zsol added style T: style What do we want Blackened code to look like? and removed style labels Jul 22, 2019
@JelleZijlstra
Copy link
Collaborator

#826 would fix this

And so it did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: comments The syntactic kind. Not in the language grammar, always on our minds. Best bugs. T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

3 participants