/scalafix-exclude-implicits

Scalafix rule to exclude specific implicits

Primary LanguageScala

Scalafix rule to exclude specific implicits

This project attempts to solve SO question: Exclude a specific implicit from a Scala project

Scalafix can inspect synthetic code such as inferred type parameters, implicit arguments, implicit conversions, inferred .apply and for-comprehensions.

TODO: Replace the inefficient implementation which uses String.contains with perhaps ApplyTree.

scalafixDependencies in ThisBuild += "com.gu" %% "scalafix-exclude-implicits" % "0.1.0-SNAPSHOT",

.scalafix.conf:

rule = ExcludedImplicitsRule
ExcludedImplicitsRuleConfig.blacklist = [
  fallbackSystemCodec
  myUnwantedImplicit
]

scalacOptions:

scalacOptions ++= List(
      "-Yrangepos",
      "-Xplugin-require:semanticdb",
      "-P:semanticdb:synthetics:on"
    )

Publish locally with sbt rules/publishLocal

Code is based on: