Merged
Conversation
This was referenced Jun 8, 2023
Member
Author
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Contributor
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
60dd48a to
26a4a83
Compare
2fd8f14 to
b25a3ac
Compare
26a4a83 to
3be5049
Compare
b25a3ac to
226aabf
Compare
dcb2aaa to
3b8b3a9
Compare
226aabf to
b9826c1
Compare
This was referenced Jun 9, 2023
konstin
approved these changes
Jun 9, 2023
| else_comments = trailing_alternate_comments; | ||
| last_node_of_previous_body = body.last(); | ||
|
|
||
| if let Some(elif) = else_if(orelse) { |
Member
There was a problem hiding this comment.
Does this mean there's no elif node, just if?
Member
Author
There was a problem hiding this comment.
Yep. elif is represented as an else body that contains a single if statement. Rome (and Roslyn) model this very similarly where the alternate (else) is either an if statement (in which it is an else if) or a block (an else).
This file contains hidden or 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
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 PR implements the formatting of
ifstatements. I haven't verified if it covers all edge cases becausethat will be easier once we have better coverage (you can simply go througth the black differences), but I believe it covers most reasonable uses pretty well.
Test Plan
A few own unit tests and reviewed (as best as I can) the black differences