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

add option: allow_block_newline #3686

Closed
wants to merge 1 commit into from
Closed

add option: allow_block_newline #3686

wants to merge 1 commit into from

Conversation

mathause
Copy link

Description

Checklist - did you ...

This is an attempt to close #3551 via an option. This is certainly a WIP but I'd like to get feedback before continuing.

  1. Is the approach via an option what you want to go for? Or do you consider reverting the style change for 2024 (as @JelleZijlstra hinted in Allow a single newline after opening blocks, possibly via an option setting #3551 (comment))?
  2. What about the name of the option? I went for allow_block_newline but am of course fine to change. (For similar options you rather went with skip_*, so skip_removing_block_newline?)

(Another possibility would be to do block_newline = Literal["remove", "allow", "enforce"], just to throw that into the discussion.)

@JelleZijlstra
Copy link
Collaborator

I don't want a new option for this. We minimize the use of options so that Black's style is consistent. Whatever we end up with, it should be the same for all users.

@return42
Copy link

return42 commented May 12, 2023

I don't want a new option for this.

@JelleZijlstra OK / I understand ... but ...

We minimize the use of options so that Black's style is consistent. Whatever we end up with, it should be the same for all users.

when pin Black is not a alternative and an option is not wanted .. what alternatives are you suggest?

EDIT: haven't seen your comment #3551 (comment)

@JelleZijlstra
Copy link
Collaborator

when pin Black is not a alternative and an option is not wanted .. what alternatives are you suggest?

Either you pin Black, and always get the same formatting, or you don't pin it, and you sometimes get changes (but only when a new year comes around or you use --preview). You can't have it both ways.

@mathause
Copy link
Author

Either you pin Black, and always get the same formatting, or you don't pin it, and you sometimes get changes (but only when a new year comes around or you use --preview). You can't have it both ways.

I don't think the problem is that applying black leads to changes but with this specific change that makes the code less readable (at least that is my issue).

@mathause mathause closed this May 22, 2023
@mathause mathause deleted the add_allow_block_newline branch May 22, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow a single newline after opening blocks, possibly via an option setting
3 participants