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/15 12:18:49 UTC
[incubator-pekko-connectors-kafka] 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-connectors-kafka.git
The following commit(s) were added to refs/heads/main by this push:
new a873ded7 Add github workflow to check scala code is formatted
a873ded7 is described below
commit a873ded77946c2dc9114fa891882665368118843
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Sun Jan 15 12:53:35 2023 +0100
Add github workflow to check scala code is formatted
---
.github/workflows/format.yml | 24 ++++++++++++++++++++++++
build.sbt | 8 --------
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 00000000..502401a8
--- /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.6.1'
+ arguments: '--list --mode diff-ref=origin/main'
diff --git a/build.sbt b/build.sbt
index 181fdf92..bd6f4c1f 100644
--- a/build.sbt
+++ b/build.sbt
@@ -38,14 +38,6 @@ TaskKey[Unit]("verifyCodeFmt") := {
throw new MessageOnlyException(
"Unformatted Java code found. Please run 'javafmtAll' and commit the reformatted code")
}
- 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", "headerCheck; verifyCodeFmt")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org