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

RemoveScala3OptionalBraces: handle infix on rbrace #3576

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

kitbellew
Copy link
Collaborator

Instead of handling a specific owner of the left brace (previously, it was a Term.Match only), let's instead look for infix when we encounter the right brace instead, and ensure that the next token is not the op of an infix.

This also handles the case when Term.Match was not an LHS but in the middle of an infix chain.

Follow-on to #3573.

Instead of handling a specific owner of the left brace (previously, it
was a Term.Match only), let's instead look for infix when we encounter
the right brace instead, and ensure that the next token is not the op
of an infix.

This also handles the case when Term.Match was not an LHS but in the
middle of an infix chain.
@lenguyenthanh
Copy link

hey @kitbellew, it seems you fixed some (or all) of the issues I mentioned in discord. Do I need create those issues any more?

p/s thanks for your quick fix!

@kitbellew
Copy link
Collaborator Author

hey @kitbellew, it seems you fixed some (or all) of the issues I mentioned in discord. Do I need create those issues any more?

if nothing remains, then no.

@kitbellew kitbellew requested a review from tgodzik July 6, 2023 16:46
@kitbellew kitbellew merged commit f8539f2 into scalameta:master Jul 7, 2023
8 checks passed
@kitbellew kitbellew deleted the 3576 branch July 7, 2023 10:16
srowen pushed a commit to apache/spark that referenced this pull request Sep 2, 2023
### What changes were proposed in this pull request?
The pr aims to upgrade `scalafmt` from 3.7.5 to 3.7.13.

### Why are the changes needed?
1.The newest version include some bug fixed, eg:
- FormatWriter: accumulate align shift correctly (scalameta/scalafmt#3615)
- Indents: ignore fewerBraces if indentation is 1 (scalameta/scalafmt#3592)
- RemoveScala3OptionalBraces: handle infix on rbrace (scalameta/scalafmt#3576)

2.The full release notes:
https://github.com/scalameta/scalafmt/releases/tag/v3.7.13
https://github.com/scalameta/scalafmt/releases/tag/v3.7.12
https://github.com/scalameta/scalafmt/releases/tag/v3.7.11
https://github.com/scalameta/scalafmt/releases/tag/v3.7.10
https://github.com/scalameta/scalafmt/releases/tag/v3.7.9
https://github.com/scalameta/scalafmt/releases/tag/v3.7.8
https://github.com/scalameta/scalafmt/releases/tag/v3.7.7
https://github.com/scalameta/scalafmt/releases/tag/v3.7.6

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #42764 from panbingkun/SPARK-45043.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
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.

None yet

3 participants