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-samples.git

commit c328df4b137026a3fe82ecfd1a7fc61a28a29c66
Author: Matthew de Detrich <[email protected]>
AuthorDate: Mon Mar 20 21:55:31 2023 +0100

    Add scalafmt
---
 .github/workflows/format.yml | 24 ++++++++++++++
 .scalafmt.conf               | 78 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 0000000..4f68834
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,24 @@
+name: Scalafmt
+
+permissions: {}
+
+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/.scalafmt.conf b/.scalafmt.conf
new file mode 100644
index 0000000..3714a62
--- /dev/null
+++ b/.scalafmt.conf
@@ -0,0 +1,78 @@
+version                                  = 3.7.1
+runner.dialect                           = scala213
+project.git                              = true
+style                                    = defaultWithAlign
+docstrings.style                         = Asterisk
+docstrings.wrap                          = false
+indentOperator.preset                    = spray
+maxColumn                                = 120
+lineEndings                              = preserve
+rewrite.rules                            = [RedundantParens, SortImports, 
AvoidInfix]
+indentOperator.exemptScope               = all
+align.preset                             = some
+align.tokens."+"                         = [
+  {
+    code   = "~>"
+    owners = [
+      { regex = "Term.ApplyInfix" }
+    ]
+  }
+]
+literals.hexDigits                       = upper
+literals.hexPrefix                       = lower
+binPack.unsafeCallSite                   = always
+binPack.unsafeDefnSite                   = always
+binPack.indentCallSiteSingleArg          = false
+binPack.indentCallSiteOnce               = true
+newlines.avoidForSimpleOverflow          = [slc]
+newlines.source                          = keep
+newlines.beforeMultiline                 = keep
+align.openParenDefnSite                  = false
+align.openParenCallSite                  = false
+align.allowOverflow                      = true
+optIn.breakChainOnFirstMethodDot         = false
+optIn.configStyleArguments               = false
+danglingParentheses.preset               = false
+spaces.inImportCurlyBraces               = true
+rewrite.neverInfix.excludeFilters        = [
+  at
+  and
+  min
+  max
+  until
+  to
+  by
+  eq
+  ne
+  "should.*"
+  "contain.*"
+  "must.*"
+  in
+  ignore
+  be
+  taggedAs
+  thrownBy
+  synchronized
+  have
+  when
+  size
+  only
+  noneOf
+  oneElementOf
+  noElementsOf
+  atLeastOneElementOf
+  atMostOneElementOf
+  allElementsOf
+  inOrderElementsOf
+  theSameElementsAs
+  theSameElementsInOrderAs
+]
+rewriteTokens          = {
+  "⇒": "=>"
+  "→": "->"
+  "←": "<-"
+}
+project.excludeFilters = [
+  "scripts/authors.scala"
+]
+project.layout         = StandardConvention


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

Reply via email to