From 658d522ec5e341a59c260457e11047a5c86c61f6 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Mon, 13 Sep 2021 09:06:22 -0700 Subject: [PATCH] ScalafmtConfig: make most methods package-private --- .../org/scalafmt/config/ScalafmtConfig.scala | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfig.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfig.scala index fcb1f02a89..e47df746fa 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfig.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfig.scala @@ -140,7 +140,7 @@ case class ScalafmtConfig( fileOverride: Conf.Obj = Conf.Obj.empty, xmlLiterals: XmlLiterals = XmlLiterals() ) { - lazy val alignMap: Map[String, Seq[AlignToken.Matcher]] = + private[scalafmt] lazy val alignMap: Map[String, Seq[AlignToken.Matcher]] = align.tokens.map(x => x.code -> x).toMap.map { case (k, v) => k -> v.getMatcher } @@ -173,16 +173,16 @@ case class ScalafmtConfig( .getOrElse(this) } - lazy val encloseSelectChains = + private[scalafmt] lazy val encloseSelectChains = optIn.encloseClassicChains || newlines.source.ne(Newlines.classic) - def indentOperatorTopLevelOnly = + private[scalafmt] def indentOperatorTopLevelOnly = indentOperator.topLevelOnly && !unindentTopLevelOperators - lazy val docstringsWrapMaxColumn: Int = + private[scalafmt] lazy val docstringsWrapMaxColumn: Int = docstrings.wrapMaxColumn.getOrElse(maxColumn) - lazy val dialect = runner.getDialect + private[scalafmt] lazy val dialect = runner.getDialect } object ScalafmtConfig { @@ -243,7 +243,7 @@ object ScalafmtConfig { /** Ready styles provided by scalafmt. */ - val activeStyles: Map[String, ScalafmtConfig] = + private val activeStyles: Map[String, ScalafmtConfig] = Map( "Scala.js" -> scalaJs, "IntelliJ" -> intellij @@ -252,13 +252,13 @@ object ScalafmtConfig { defaultWithAlign ) - val availableStyles: Map[String, ScalafmtConfig] = { + private val availableStyles: Map[String, ScalafmtConfig] = { activeStyles ++ LoggerOps.name2style( scalaJs ) }.map { case (k, v) => k.toLowerCase -> v } - def conservativeRunner: ScalafmtRunner = + private[scalafmt] def conservativeRunner: ScalafmtRunner = default.runner.copy( optimizer = default.runner.optimizer.copy( // The tests were not written in this style