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

ConvertToNewScala3Syntax: use the new granular parameter #3735

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

kitbellew
Copy link
Collaborator

Supersedes #3732.

@tgodzik
Copy link
Contributor

tgodzik commented Dec 27, 2023

Do we really need this to be that granular? Maybe it's enough to have separate changes for optional braces and separate for things that are not affected by it?

@kitbellew
Copy link
Collaborator Author

@tgodzik i thought about it. looked at braces rewrite which has over time become rather granular, same for indent which had originally been declared inviolate and fixed, and decided to avoid further requests 🙂

@tgodzik
Copy link
Contributor

tgodzik commented Dec 27, 2023

@tgodzik i thought about it. looked at braces rewrite which has over time become rather granular, same for indent which had originally been declared inviolate and fixed, and decided to avoid further requests 🙂

I think in this case we should not allow to have different if and when convention. But it's up to you, I don't think it would ever make sense and it would be valid to close any such request as not planned.

@kitbellew
Copy link
Collaborator Author

@tgodzik agreed, let's merge if and while. lump for with these two?

@kitbellew
Copy link
Collaborator Author

also, since i am not a big expert on backports to scala213 (via ...source3), would importAs and importStar make sense as a single flag (say, simply imports)?

Comment on lines 64 to 66
ifCond: Boolean = true,
whileCond: Boolean = true,
forEnum: Boolean = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ifCond: Boolean = true,
whileCond: Boolean = true,
forEnum: Boolean = true,
optionalBraces = true

Comment on lines 67 to 71
varargStar: Boolean = true,
importStar: Boolean = true,
importAs: Boolean = true,
typeWildcardQuestionMark: Boolean = true,
typePlaceholderUnderscore: Boolean = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
varargStar: Boolean = true,
importStar: Boolean = true,
importAs: Boolean = true,
typeWildcardQuestionMark: Boolean = true,
typePlaceholderUnderscore: Boolean = true
deprecatedSyntax = true

maybe? This would be controlled by the dialect to see if the new syntax is allowed.

Otherwise if only one thing is set then the user will be quite confused. The separate non optional braces (traditional braced if etc.) will probably not be deprecated ever,.

@kitbellew
Copy link
Collaborator Author

@tgodzik all done

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kitbellew kitbellew merged commit 3f34bf3 into scalameta:master Dec 28, 2023
9 checks passed
@kitbellew kitbellew deleted the 3732 branch December 28, 2023 14:02
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.

2 participants