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

Refactor the comment handling of a statement's last expression #8920

Merged

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Nov 30, 2023

Summary

This refactor simplifies implementing #6975. I also find it easier to understand where this layout is used because the explicit calls in the assignment formatting compared to inside (anyway complicated) maybe_parenthesize function.

Test Plan

cargo test

The similarity index remains unchanged

project similarity index total files changed files
cpython 0.75804 1799 1648
django 0.99984 2772 34
home-assistant 0.99963 10596 146
poetry 0.99925 317 12
transformers 0.99967 2657 322
twine 1.00000 33 0
typeshed 0.99980 3669 18
warehouse 0.99977 654 13
zulip 0.99970 1459 21

@MichaReiser MichaReiser changed the title Refactor the comment handling of a statement's last expression WIP: Refactor the comment handling of a statement's last expression Nov 30, 2023
@MichaReiser MichaReiser added the internal An internal refactor or improvement label Nov 30, 2023
@MichaReiser MichaReiser force-pushed the refactor-last-statement-expression-comment-formatting branch from 79015da to 76110f7 Compare November 30, 2023 03:04
Copy link
Contributor

github-actions bot commented Nov 30, 2023

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser MichaReiser force-pushed the refactor-last-statement-expression-comment-formatting branch from 76110f7 to 1de4fcd Compare December 1, 2023 04:41
@MichaReiser MichaReiser changed the title WIP: Refactor the comment handling of a statement's last expression Refactor the comment handling of a statement's last expression Dec 1, 2023
@MichaReiser MichaReiser marked this pull request as ready for review December 1, 2023 04:43
@MichaReiser MichaReiser merged commit 8088c53 into main Dec 4, 2023
17 checks passed
@MichaReiser MichaReiser deleted the refactor-last-statement-expression-comment-formatting branch December 4, 2023 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants