-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
POC of assert formatting #6857
Closed
Closed
POC of assert formatting #6857
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Merged
MichaReiser
commented
Aug 24, 2023
Comment on lines
+239
to
+264
assert { | ||
key1: value1, | ||
key2: value2, | ||
key3: value3, | ||
key4: value4, | ||
key5: value5, | ||
key6: value6, | ||
key7: value7, | ||
key8: value8, | ||
key9: value9, | ||
} == expectedeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, "Not what we expected and the message is too long to fit in one lin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String should be parenthesized
MichaReiser
commented
Aug 24, 2023
crates/ruff_python_formatter/tests/snapshots/format@statement__assert.py.snap
Show resolved
Hide resolved
MichaReiser
commented
Aug 24, 2023
Comment on lines
+251
to
+276
assert { | ||
key1: value1, | ||
key2: value2, | ||
key3: value3, | ||
key4: value4, | ||
key5: value5, | ||
key6: value6, | ||
key7: value7, | ||
key8: value8, | ||
key9: value9, | ||
} == expectedeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, "Not what we expected and the message is too long to fit in one lineeeeeeeeeeeeeeeee" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String should be parenthesized
This comment was marked as outdated.
This comment was marked as outdated.
MichaReiser
force-pushed
the
poc-of-assert-formatting
branch
from
September 19, 2023 09:09
5070d10
to
d1a76d0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a POC of formatting assertions where the left side is a
can_omit_optional_parenthees
expressionstarting with a parenthesized expression and the right is a string.
This PR doesn't perfectly match black yet, but the similarity index aren't improving for any of our tested projects, which makes me question whether this is worth perusing.
I'm putting this up to get feedback on how important this formatting is. You can ignore the implementation and just look at the
assert.py
changes.Test Plan