black icon indicating copy to clipboard operation
black copied to clipboard

Draft for Black 2023 stable style

Open JelleZijlstra opened this issue 3 years ago • 3 comments

This shouldn't be merged before 2023 (in case we want to do another 22.12 release) and shouldn't be merged until we have consensus in #3407. I'm opening it so I can evaluate the effect of the draft 2023 style without the obviously problematic bits.

Closes #3407

  • Clean up comments.py preview mode
  • Clean up preview in init.py
  • clean up normalize_invisible_parens preview
  • more in linegen.py
  • annotation_parens
  • empty_lines_before_class_or_def_with_leading_comments
  • handle_trailing_commas_in_head
  • normalize_docstring_quotes_and_prefixes_properly (unused)
  • one_element_subscript
  • remove_block_trailing_newline
  • remove_redundant_parens
  • skip_magic_trailing_comma_in_subscript

TODO:

  • [ ] Finalize decisions on style
  • [ ] Clean up tests
  • [ ] Verify all known crashers in the preview style don't apply on this branch
  • [ ] Write a changelog entry

JelleZijlstra avatar Dec 10 '22 16:12 JelleZijlstra

diff-shades reports zero changes comparing this PR (1c8d15749da9fb4a760289a7b8e3e559e84858c5) to main (226cbf0226ee3bc26972357ba54c36409e9a84ae).


What is this? | Workflow run | diff-shades documentation

github-actions[bot] avatar Dec 10 '22 17:12 github-actions[bot]

I ran this on our internal codebase and was pretty happy with the result. Most of the changes I saw were removing blank lines (#3035). This PR currently leaves #3044 and experimental string processing in preview.

I'll defer working on this PR more (e.g., getting tests to pass) until my other PRs from today are merged.

JelleZijlstra avatar Dec 10 '22 21:12 JelleZijlstra

CI is green now apart from diff-shades telling me I changed the stable style, which is expected since that's the point of this PR.

I think tomorrow I'll cut a 23.1a1 release off this branch.

JelleZijlstra avatar Dec 18 '22 04:12 JelleZijlstra

Sounds like it should be named 23.2.0 ;)

Jackenmen avatar Jan 31 '23 07:01 Jackenmen

As long as it's still January in California when we release it I'm calling it 23.1.0 :)

JelleZijlstra avatar Jan 31 '23 14:01 JelleZijlstra