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

ScalafmtRunner: add dialectOverride #3300

Merged
merged 4 commits into from
Aug 22, 2022
Merged

Conversation

kitbellew
Copy link
Collaborator

No description provided.

With dialect overrides to be added subsequently, comparing dialects for
reference equality is no longer sufficient.
Also, make a copy in config, to enable subsequent dialect override.
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.

Looks good, but I do have a question about the usability. Isn't it harder for the user to try to figure this out instead of having relevant predefined dialects?

assert(!config1.runner.getDialect.allowToplevelTerms)
val config2 = Config
.fromHoconString("""
|runner.dialectOverride.allowToplevelTerms = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it only needed for toplevel terms ? Maybe we should have a dialect for scripts instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not at all, this is just a test to show that override works.

@kitbellew
Copy link
Collaborator Author

Looks good, but I do have a question about the usability. Isn't it harder for the user to try to figure this out instead of having relevant predefined dialects?

while having predefined dialects works well, we have had complaints in the past when some change in scala3 was backported to Scala 2, or kind projector plugin had a new feature, and rather than us trying to keep up, this will allow people to enable features themselves.

@kitbellew kitbellew merged commit ae5df22 into scalameta:master Aug 22, 2022
@kitbellew kitbellew deleted the 3300 branch August 22, 2022 17:44
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