cozydev-pink / protosearch

prototype search library in pure scala
https://cozydev-pink.github.io/protosearch/
Apache License 2.0
9 stars 6 forks source link

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

Open valencik opened 6 months ago

valencik commented 6 months ago

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 commented 6 months ago

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