This is an automated email from the ASF dual-hosted git repository.

nvollmar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-management.git


The following commit(s) were added to refs/heads/main by this push:
     new b878d9c  Adds code style check (#9)
b878d9c is described below

commit b878d9ca4670c0640a84902b0bdc4eb47c000786
Author: Nicolas Vollmar <[email protected]>
AuthorDate: Tue Jan 17 14:12:51 2023 +0100

    Adds code style check (#9)
---
 .github/workflows/checks.yml |  2 +-
 build.sbt                    | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 19fb6c5..565b50f 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -34,7 +34,7 @@ jobs:
         uses: coursier/[email protected]
 
       - name: Compilation and binary-compatibility check
-        run: sbt 
"headerCheckAll;+IntegrationTest/compile;mimaReportBinaryIssues"
+        run: sbt 
"verifyCodeStyle;+IntegrationTest/compile;mimaReportBinaryIssues"
 
   check-docs:
     name: Check Docs
diff --git a/build.sbt b/build.sbt
index b479bbd..3113612 100644
--- a/build.sbt
+++ b/build.sbt
@@ -302,3 +302,16 @@ lazy val docs = project
       "scaladoc.akka.management.base_url" -> s"/${(Preprocess / 
siteSubdirName).value}/"),
     publishRsyncArtifacts += makeSite.value -> "www/",
     publishRsyncHost := "[email protected]")
+
+TaskKey[Unit]("verifyCodeFmt") := {
+  
scalafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach
 { _ =>
+    throw new MessageOnlyException(
+      "Unformatted Scala code found. Please run 'scalafmtAll' and commit the 
reformatted code")
+  }
+  (Compile / scalafmtSbtCheck).result.value.toEither.left.foreach { _ =>
+    throw new MessageOnlyException(
+      "Unformatted sbt code found. Please run 'scalafmtSbt' and commit the 
reformatted code")
+  }
+}
+
+addCommandAlias("verifyCodeStyle", "headerCheckAll; verifyCodeFmt")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to