From ebed6e893727e89a0379c0dbbdb5f3aeca7c7ac4 Mon Sep 17 00:00:00 2001 From: Tai Le Manh Date: Thu, 22 Aug 2024 18:19:24 +0700 Subject: [PATCH] Migrate javafmtCheckSettings to project/Checkstyle Signed-off-by: Tai Le Manh --- build.sbt | 5 ----- project/Checkstyle.scala | 13 +++++++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sbt b/build.sbt index a54837543d9..e78dfa7454b 100644 --- a/build.sbt +++ b/build.sbt @@ -156,11 +156,6 @@ lazy val commonSettings = Seq( unidocSourceFilePatterns := Nil, ) -// enforce java code style -def javafmtCheckSettings() = Seq( - (Compile / compile) := ((Compile / compile) dependsOn (Compile / javafmtCheckAll)).value -) - /** * Note: we cannot access sparkVersion.value here, since that can only be used within a task or * setting macro. diff --git a/project/Checkstyle.scala b/project/Checkstyle.scala index ee6906522c9..66ca6c682bf 100644 --- a/project/Checkstyle.scala +++ b/project/Checkstyle.scala @@ -14,10 +14,11 @@ * limitations under the License. */ -import com.etsy.sbt.checkstyle.CheckstylePlugin.autoImport._ -import org.scalastyle.sbt.ScalastylePlugin.autoImport._ -import sbt._ -import sbt.Keys._ +import com.etsy.sbt.checkstyle.CheckstylePlugin.autoImport.* +import com.lightbend.sbt.JavaFormatterPlugin.autoImport.javafmtCheckAll +import org.scalastyle.sbt.ScalastylePlugin.autoImport.* +import sbt.* +import sbt.Keys.* object Checkstyle { @@ -100,4 +101,8 @@ object Checkstyle { } } + // Enforce java code style + lazy val javafmtCheckSettings = Seq( + (Compile / compile) := ((Compile / compile) dependsOn (Compile / javafmtCheckAll)).value + ) }