Draft for Black 2023 stable style
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
diff-shades reports zero changes comparing this PR (1c8d15749da9fb4a760289a7b8e3e559e84858c5) to main (226cbf0226ee3bc26972357ba54c36409e9a84ae).
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.
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.
Sounds like it should be named 23.2.0 ;)
As long as it's still January in California when we release it I'm calling it 23.1.0 :)