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 2023/01/27 14:20:09 UTC

[incubator-pekko-http] 02/02: 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-http.git

commit fde93b0e6acbd92df228697b086c1dbcfd389b5d
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Fri Jan 27 14:23:18 2023 +0100

    Add github workflow to check scala code is formatted
---
 .github/workflows/format.yml            | 24 ++++++++++++++++++++++++
 .github/workflows/validate-and-test.yml |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 000000000..9d330b61d
--- /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@v3
+        with:
+          fetch-depth: 0
+          persist-credentials: false
+
+      - name: Check project is formatted
+        uses: jrouly/scalafmt-native-action@v2
+        with:
+          version: '3.7.1'
+          arguments: '--list --mode diff-ref=origin/main'
diff --git a/.github/workflows/validate-and-test.yml b/.github/workflows/validate-and-test.yml
index e4a631ef1..4dfd6cbee 100644
--- a/.github/workflows/validate-and-test.yml
+++ b/.github/workflows/validate-and-test.yml
@@ -33,8 +33,8 @@ jobs:
           path: project/**/target
           key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}
 
-      - name: Check code is formatted
-        run: sbt scalafmtCheckAll scalafmtSbtCheck headerCheckAll
+      - name: Check headers
+        run: sbt headerCheckAll
 
       - name: Check for missing formatting
         run: git diff --exit-code --color


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