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

Avoid double indentation when unnecessary #4505

Closed
ego-thales opened this issue Nov 5, 2024 · 2 comments
Closed

Avoid double indentation when unnecessary #4505

ego-thales opened this issue Nov 5, 2024 · 2 comments
Labels
T: enhancement New feature or request

Comments

@ego-thales
Copy link

Hello,

I'd like your opinion on black's handling of the following case and what I think would be preferable

# Original
A = func([fooooooooooooooooooooooooooooooooooooooo for bar in baaaaaaaaaaaaaaaaaaaaaaaaaaaaaz])

# Current black
A = func(
    [
        fooooooooooooooooooooooooooooooooooooooo
        for bar in baaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
    ]
)

# Preferred
A = func([
    fooooooooooooooooooooooooooooooooooooooo
    for bar in baaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
])

Do you think it would be reasonable to hope for in future developments of black?

Thanks for your time.

@ego-thales ego-thales added the T: enhancement New feature or request label Nov 5, 2024
@JelleZijlstra
Copy link
Collaborator

This is already in the unstable style, as documented at https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#labels-hug-parens . However, we can't stabilize this until a number of issues and crashes have been fixed (#4036, #4098, #4099).

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
@ego-thales
Copy link
Author

Very promising! Thank you for your work and your answer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants