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

Remove Comprehension priority #6947

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Aug 28, 2023

Summary

This PR removes the Comprehension Priority from can_omit_parentheses because Black seems to omit parentheses even if there are multiple parentheses.

I'm not entirely sure why. Or better, I'm not entirely sure what the following checks in Black are for

https://github.com/psf/black/blob/b4dca26c7d93f930bbd5a7b552807370b60d4298/src/black/brackets.py#L266-L283

But I suggest to remove the priority for now and re-introduce the priority when we come across some code that gets formatted incorrectly

Test Plan

  • I added a new test
  • I double checked that it doesn't introduce new regressions in the django project
  • It improves the similarity overall

This PR

project similarity index
cpython 0.76082
django 0.99902
transformers 0.99850
twine 0.99982
typeshed 0.99953
warehouse 0.99648
zulip 0.99924

Main

project similarity index
cpython 0.76081
django 0.99899
transformers 0.99842
twine 0.99929
typeshed 0.99953
warehouse 0.99646
zulip 0.99922

@MichaReiser
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@MichaReiser MichaReiser added the formatter Related to the formatter label Aug 28, 2023
@MichaReiser MichaReiser merged commit 715d86d into main Aug 29, 2023
16 checks passed
@MichaReiser MichaReiser deleted the remove-comprehension-priority branch August 29, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants