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

Draft for Black 2023 stable style #3418

Merged
merged 39 commits into from Jan 31, 2023
Merged

Draft for Black 2023 stable style #3418

merged 39 commits into from Jan 31, 2023

Conversation

JelleZijlstra
Copy link
Collaborator

@JelleZijlstra JelleZijlstra commented Dec 10, 2022

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

This reverts commit b6cd780.
@github-actions
Copy link

github-actions bot commented Dec 10, 2022

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


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

@JelleZijlstra
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

Copy link
Collaborator

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting there. Just one more day and then 23.1.0 will be out.

PR looks good, although I think you can delete everything under this header. You might want to keep/move the "Improved empty line management" stuff to the stable docs though as subpoint 1 could surprise some people.

@Jackenmen
Copy link
Contributor

Sounds like it should be named 23.2.0 ;)

@JelleZijlstra
Copy link
Collaborator Author

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

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.

Setting the 2023 stable style
3 participants