From 9ec2e8005a9e08a178f71f799b453251e91a46ea Mon Sep 17 00:00:00 2001 From: Albert Meltzer Date: Thu, 22 Feb 2024 15:49:34 -0800 Subject: [PATCH] Scalafmt: use .forSbt for .sbt files only Ammonite and/or markdown were really just looking to enable the top-level terms flag in the dialect, which has already been enabled for all files anyway. --- .../shared/src/main/scala/org/scalafmt/Scalafmt.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/Scalafmt.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/Scalafmt.scala index cf594d5756..c9d9edc2b5 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/Scalafmt.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/Scalafmt.scala @@ -65,8 +65,7 @@ object Scalafmt { filename: String = defaultFilename ): Formatted.Result = { def getStyleByFile(style: ScalafmtConfig) = { - val isSbt = FileOps.isAmmonite(filename) || FileOps.isSbt(filename) || - FileOps.isMarkdown(filename) + val isSbt = FileOps.isSbt(filename) if (isSbt) style.forSbt else style } val styleTry =