-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commits: scalafix-cli3 cross compiled for scala3 (not really…
… squashed but commit messages should be consistent)
- Loading branch information
Showing
7 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
scalafix-cli/src/main/scala-3/scalafix/internal/v1/TPrintImplicits.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package scalafix.internal.v1 | ||
|
||
import java.nio.file.PathMatcher | ||
|
||
import scala.meta.io.AbsolutePath | ||
|
||
import metaconfig.Conf | ||
import metaconfig.pprint._ | ||
import scalafix.internal.config.ScalafixConfig | ||
|
||
class TPrintImplicits { | ||
implicit val absolutePathPrint: TPrint[AbsolutePath] = | ||
new TPrint[AbsolutePath] { | ||
def render(implicit tpc: TPrintColors): fansi.Str = fansi.Str("<path>") | ||
} | ||
|
||
implicit val pathMatcherPrint: TPrint[PathMatcher] = | ||
new TPrint[PathMatcher] { | ||
def render(implicit tpc: TPrintColors): fansi.Str = fansi.Str("<glob>") | ||
} | ||
|
||
implicit val confPrint: TPrint[Conf] = | ||
new TPrint[Conf] { | ||
def render(implicit tpc: TPrintColors): fansi.Str = | ||
TPrint.implicitly[ScalafixConfig].render | ||
} | ||
|
||
implicit def optionPrint[T](implicit ev: TPrint[T]): TPrint[Option[T]] = | ||
new TPrint[Option[T]] { | ||
def render(implicit tpc: TPrintColors): fansi.Str = ev.render | ||
} | ||
|
||
implicit def iterablePrint[C[x] <: Iterable[x], T](implicit | ||
ev: TPrint[T] | ||
): TPrint[C[T]] = | ||
new TPrint[C[T]] { | ||
def render(implicit tpc: TPrintColors): fansi.Str = s"[${ev.render} ...]" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters