From 13a04d2f3bd030bde4cc7c7e312352993e200a05 Mon Sep 17 00:00:00 2001 From: Cheng Lian Date: Tue, 5 May 2020 01:56:33 -0700 Subject: [PATCH] Update scalafmt-core to 2.5.1 (#35) --- .scalafmt.conf | 2 +- .../src/main/scala/fix/OrganizeImports.scala | 9 ++++---- .../scala/fix/OrganizeImportsConfig.scala | 21 +++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 95640c7bc..dff12269a 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "2.4.2" +version = "2.5.1" align { arrowEnumeratorGenerator = false diff --git a/rules/src/main/scala/fix/OrganizeImports.scala b/rules/src/main/scala/fix/OrganizeImports.scala index a03d1b0f2..da0a3d810 100644 --- a/rules/src/main/scala/fix/OrganizeImports.scala +++ b/rules/src/main/scala/fix/OrganizeImports.scala @@ -76,10 +76,11 @@ class OrganizeImports(config: OrganizeImportsConfig) extends SemanticRule("Organ .map(_.position) .toSet - def importeePosition(importee: Importee): Position = importee match { - case Importee.Rename(from, _) => from.pos - case _ => importee.pos - } + def importeePosition(importee: Importee): Position = + importee match { + case Importee.Rename(from, _) => from.pos + case _ => importee.pos + } val unusedRemoved = importer.importees filterNot { importee => unusedImports contains importeePosition(importee) diff --git a/rules/src/main/scala/fix/OrganizeImportsConfig.scala b/rules/src/main/scala/fix/OrganizeImportsConfig.scala index cb8238ab8..a5b523329 100644 --- a/rules/src/main/scala/fix/OrganizeImportsConfig.scala +++ b/rules/src/main/scala/fix/OrganizeImportsConfig.scala @@ -12,9 +12,10 @@ object ImportsOrder { case object Ascii extends ImportsOrder case object SymbolsFirst extends ImportsOrder - implicit def reader: ConfDecoder[ImportsOrder] = ReaderUtil.fromMap { - List(Ascii, SymbolsFirst) groupBy (_.toString) mapValues (_.head) - } + implicit def reader: ConfDecoder[ImportsOrder] = + ReaderUtil.fromMap { + List(Ascii, SymbolsFirst) groupBy (_.toString) mapValues (_.head) + } } sealed trait ImportSelectorsOrder @@ -24,9 +25,10 @@ object ImportSelectorsOrder { case object SymbolsFirst extends ImportSelectorsOrder case object Keep extends ImportSelectorsOrder - implicit def reader: ConfDecoder[ImportSelectorsOrder] = ReaderUtil.fromMap { - List(Ascii, SymbolsFirst, Keep) groupBy (_.toString) mapValues (_.head) - } + implicit def reader: ConfDecoder[ImportSelectorsOrder] = + ReaderUtil.fromMap { + List(Ascii, SymbolsFirst, Keep) groupBy (_.toString) mapValues (_.head) + } } sealed trait GroupedImports @@ -36,9 +38,10 @@ object GroupedImports { case object Explode extends GroupedImports case object Keep extends GroupedImports - implicit def reader: ConfDecoder[GroupedImports] = ReaderUtil.fromMap { - List(Merge, Explode, Keep) groupBy (_.toString) mapValues (_.head) - } + implicit def reader: ConfDecoder[GroupedImports] = + ReaderUtil.fromMap { + List(Merge, Explode, Keep) groupBy (_.toString) mapValues (_.head) + } } final case class OrganizeImportsConfig(