Skip to content

Commit

Permalink
refactor: Refactor searching for config and remove handling of no lon…
Browse files Browse the repository at this point in the history
…ger relevant option
  • Loading branch information
tgodzik committed Oct 27, 2023
1 parent 238fcde commit f985a07
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ final class FormattingProvider(
tables.dismissedNotifications.CreateScalafmtFile
.dismiss(24, TimeUnit.HOURS)
None
} else if (item == Messages.dontShowAgain) {
tables.dismissedNotifications.CreateScalafmtFile
.dismissForever()
None
} else None
}
} else Future.successful(None)
Expand Down Expand Up @@ -425,13 +421,10 @@ final class FormattingProvider(
val configpath = userConfig().scalafmtConfigPath
val default: Option[AbsolutePath] = {
val defaultLocation = projectRoot.resolve(defaultScalafmtLocation)
lazy val scalacliDefault =
val scalacliDefault =
projectRoot.resolve(".scala-build/.scalafmt.conf")
lazy val hiddenDefault = projectRoot.resolve(Directories.hiddenScalafmt)
if (defaultLocation.exists) Some(defaultLocation)
else if (scalacliDefault.exists) Some(scalacliDefault)
else if (hiddenDefault.exists) Some(hiddenDefault)
else None
val hiddenDefault = projectRoot.resolve(Directories.hiddenScalafmt)
List(defaultLocation, scalacliDefault, hiddenDefault).find(_.exists)
}
configpath.orElse(default)
}
Expand Down

0 comments on commit f985a07

Please sign in to comment.