You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by md...@apache.org on 2022/11/11 07:58:10 UTC

[incubator-pekko-grpc] branch main updated: Add github workflow to check scala code is formatted

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 669f7c22 Add github workflow to check scala code is formatted
669f7c22 is described below

commit 669f7c22c60493e79198e049d0592e9abfbfc00f
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Thu Nov 10 10:17:49 2022 +0100

    Add github workflow to check scala code is formatted
---
 .github/workflows/build-test.yml |  4 ++--
 .github/workflows/format.yml     | 24 ++++++++++++++++++++++++
 project/Common.scala             |  4 +---
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index e232e9a6..4edf7437 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -38,10 +38,10 @@ jobs:
         env:
           FOSSA_API_KEY: "${{secrets.FOSSA_API_KEY}}"
 
-      - name: Code style check and binary-compatibility check
+      - name: Binary-compatibility check
         run: |-
           cp .jvmopts-ghactions .jvmopts
-          sbt scalafmtCheckAll scalafmtSbtCheck headerCheckAll grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues
+          sbt headerCheckAll grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues
 
   compile-benchmarks:
     name: Compile Benchmarks
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 00000000..9ce98e55
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,24 @@
+name: Scalafmt
+
+permissions: read-all
+
+on:
+  pull_request:
+    branches: ['**']
+
+jobs:
+  build:
+    name: Code is formatted
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout current branch (full)
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+          persist-credentials: false
+
+      - name: Check project is formatted
+        uses: jrouly/scalafmt-native-action@v2
+        with:
+          version: '3.6.1'
+          arguments: '--list --mode diff-ref=origin/main'
diff --git a/project/Common.scala b/project/Common.scala
index 0d45d1c1..cc8b6925 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -5,7 +5,6 @@ import sbt._
 import sbt.plugins.JvmPlugin
 import akka.grpc.Dependencies.Versions.{ scala212, scala213 }
 import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys.projectInfoVersion
-import org.scalafmt.sbt.ScalafmtPlugin.autoImport.scalafmtOnCompile
 import com.typesafe.tools.mima.plugin.MimaKeys._
 import sbtprotoc.ProtocPlugin.autoImport.PB
 import xerial.sbt.Sonatype
@@ -75,6 +74,5 @@ object Common extends AutoPlugin {
     apiURL := Some(url(s"https://doc.akka.io/api/akka-grpc/${projectInfoVersion.value}/akka/grpc/index.html")),
     (Test / testOptions) += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
     crossScalaVersions := Seq(scala212, scala213),
-    mimaReportSignatureProblems := true,
-    scalafmtOnCompile := true)
+    mimaReportSignatureProblems := true)
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org