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:
- Project was created via
sbt new scalacenter/scalafix.g8
- https://scalacenter.github.io/scalafix/docs/developers/tutorial.html
- https://github.com/scalacenter/scalafix/tree/master/scalafix-rules/src/main/scala/scalafix/internal/rule