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

Choose either * imports or _ imports and stick with them #195

Open
valencik opened this issue Mar 27, 2024 · 1 comment
Open

Choose either * imports or _ imports and stick with them #195

valencik opened this issue Mar 27, 2024 · 1 comment

Comments

@valencik
Copy link
Contributor

Sometimes we do

import cats.syntax.all.*

and sometimes we

import cats.syntax.all._

Let's choose one and stick with it.
Can we enforce this with a scalafmt rule?

@samspills
Copy link
Contributor

samspills commented Mar 27, 2024

Can we enforce this with a scalafmt rule?

I think so using the scala3 rewrites, docs here: https://scalameta.org/scalafmt/docs/configuration.html#rewritescala3converttonewsyntax

And the dialect rule that can control just the import wildcard is this one: https://github.com/scalameta/scalameta/blob/8b190319f53a4545cbfe09a0ef19b22361b8a3d4/scalameta/dialects/shared/src/main/scala/scala/meta/Dialect.scala#L134-L135

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

No branches or pull requests

2 participants