diff --git a/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtDynamic.scala b/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtDynamic.scala index c7ffa6ab2d..0c8467636d 100644 --- a/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtDynamic.scala +++ b/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtDynamic.scala @@ -133,10 +133,8 @@ final case class ScalafmtDynamic( ): FormatEval[ScalafmtReflectConfig] = { for { version <- readVersion(configPath) - current = ScalafmtReflect.current - fmtReflect <- - if (version == current.version) Right(current) - else resolveFormatter(configPath, version) + // can't use current build directly, -dynamic doesn't include -core + fmtReflect <- resolveFormatter(configPath, version) config <- fmtReflect.parseConfig(configPath).toEither.left.map { case ex: ScalafmtDynamicError => ex case ex => new UnknownConfigError(configPath, ex) diff --git a/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtReflect.scala b/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtReflect.scala index 7c945a6552..9aba332723 100644 --- a/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtReflect.scala +++ b/scalafmt-dynamic/src/main/scala/org/scalafmt/dynamic/ScalafmtReflect.scala @@ -166,12 +166,3 @@ case class ScalafmtReflect( module.get(null) } } - -object ScalafmtReflect { - - lazy val current = ScalafmtReflect( - getClass.getClassLoader, - ScalafmtVersion.parse(BuildInfo.stable).get - ) - -}