From b859d9fc4899fb8a95f2456a3e46fc6d2037bc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Wed, 13 Oct 2021 08:21:09 +0200 Subject: [PATCH] Update verifyCodeStyle and applyCodeStyle to be what we really require (#30777) Previously it included a coarse grained Java reformat which it seems was never quite worked through (reformatting generated sources etc), so go back on that, and make sure verifyCodeStyle is exactly what we require for PR validation to pass (and that it does not diverge) --- .github/workflows/build-test-prValidation.yml | 2 +- build.sbt | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-test-prValidation.yml b/.github/workflows/build-test-prValidation.yml index 579cb23e7b..1caa71a2d3 100644 --- a/.github/workflows/build-test-prValidation.yml +++ b/.github/workflows/build-test-prValidation.yml @@ -32,7 +32,7 @@ jobs: sbt -jvm-opts .jvmopts-ci \ -Dsbt.override.build.repos=false \ -Dsbt.log.noformat=false \ - scalafmtCheckAll scalafmtSbtCheck headerCheckAll + verifyCodeStyle pull-request-validation: name: Check / Tests diff --git a/build.sbt b/build.sbt index 6bc3bcb344..36fd316239 100644 --- a/build.sbt +++ b/build.sbt @@ -12,21 +12,8 @@ enablePlugins( JavaFormatterPlugin) disablePlugins(MimaPlugin) -// check format and headers -TaskKey[Unit]("verifyCodeFmt") := { - javafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ => - throw new MessageOnlyException( - "Unformatted Java code found. Please run 'javafmtAll' (or use the 'applyCodeStyle' alias) and commit the reformatted code") - } - - scalafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ => - throw new MessageOnlyException( - "Unformatted Scala code found. Please run 'scalafmtAll' (or use the 'applyCodeStyle' alias) and commit the reformatted code") - } -} - -addCommandAlias("verifyCodeStyle", "headerCheckAll; verifyCodeFmt") -addCommandAlias("applyCodeStyle", "headerCreateAll; javafmtAll; scalafmtAll") +addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; headerCheckAll") +addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbtAll") addCommandAlias( name = "fixall",