From 1242310596c04b044bce2ac8d22a805ae1a12e88 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:08:31 -0800 Subject: [PATCH] DanglingParentheses: use shortcut values --- .../main/scala/org/scalafmt/config/DanglingParentheses.scala | 4 ++-- .../src/main/scala/org/scalafmt/config/ScalafmtConfig.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/DanglingParentheses.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/DanglingParentheses.scala index 11bbfe3e93..bc34ee7723 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/DanglingParentheses.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/DanglingParentheses.scala @@ -14,8 +14,8 @@ case class DanglingParentheses( object DanglingParentheses { - private val shortcutTrue = DanglingParentheses(true, true) - private val shortcutFalse = DanglingParentheses(false, false, false) + private[config] val shortcutTrue = DanglingParentheses(true, true) + private[config] val shortcutFalse = DanglingParentheses(false, false, false) val default = shortcutTrue 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 7f975ab1c1..b6a636b86f 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 @@ -118,7 +118,7 @@ case class ScalafmtConfig( includeCurlyBraceInSelectChains: Boolean = true, includeNoParensInSelectChains: Boolean = false, assumeStandardLibraryStripMargin: Boolean = false, - danglingParentheses: DanglingParentheses = DanglingParentheses(true, true), + danglingParentheses: DanglingParentheses = DanglingParentheses.default, @annotation.DeprecatedName( "poorMansTrailingCommasInConfigStyle", "Scala supports trailing commas after 2.12.2. Use trailingCommas instead", @@ -264,7 +264,7 @@ object ScalafmtConfig { optIn = default.optIn.copy( configStyleArguments = false ), - danglingParentheses = DanglingParentheses(true, true) + danglingParentheses = DanglingParentheses.shortcutTrue ) def addAlign(style: ScalafmtConfig): ScalafmtConfig =