Skip to content

Commit 7f8404c

Browse files
committed
Setup scalafmt.
Signed-off-by: Pascal Spörri <[email protected]>
1 parent 62bc14b commit 7f8404c

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

.github/workflows/ci.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- main
1111
tags:
1212
- v*
13-
13+
1414
jobs:
1515
Build:
1616
strategy:
@@ -66,6 +66,11 @@ jobs:
6666
distribution: temurin
6767
java-version: 11
6868
cache: sbt
69+
- name: Check formatting
70+
shell: bash
71+
run: |
72+
sbt scalafmtSbtCheck
73+
sbt scalafmtCheckAll
6974
- name: Test Default Shuffle Fetch
7075
shell: bash
7176
if: startsWith(matrix.scala, '2.12.')

.scalafmt.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version = 3.7.13
2+
runner.dialect = scala212
3+
maxColumn = 120

README.md

+19-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ Examples are available [here](./examples).
1616
```bash
1717
sbt package # Creates a minimal jar.
1818
sbt assembly # Creates the full assembly with all dependencies, notably hadoop cloud.
19-
```
19+
```
20+
21+
## Formatting Code
22+
23+
Formatting is done with `scalafmt`. This can be triggered with the following configuration.
24+
25+
```bash
26+
sbt scalafmtAll # Format the source code
27+
sbt scalafmtSbt # Format the SBT.
28+
```
29+
2030

2131
## Required configuration
2232

@@ -86,14 +96,14 @@ to Java > 11:
8696
--add-opens=java.base/java.io=ALL-UNNAMED
8797
--add-opens=java.base/java.net=ALL-UNNAMED
8898
--add-opens=java.base/java.nio=ALL-UNNAMED
89-
--add-opens=java.base/java.util=ALL-UNNAMED
90-
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
91-
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
92-
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
93-
--add-opens=java.base/sun.nio.cs=ALL-UNNAMED
99+
--add-opens=java.base/java.util=ALL-UNNAMED
100+
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
101+
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
102+
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
103+
--add-opens=java.base/sun.nio.cs=ALL-UNNAMED
94104
--add-opens=java.base/sun.security.action=ALL-UNNAMED -
95-
-add-opens=java.base/sun.util.calendar=ALL-UNNAMED
96-
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
105+
-add-opens=java.base/sun.util.calendar=ALL-UNNAMED
106+
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
97107
```
98108

99109
## Usage
@@ -119,7 +129,7 @@ Add the following lines to your Spark configuration:
119129
--conf spark.hadoop.fs.s3a.endpoint=S3A_ENDPOINT
120130
--conf spark.hadoop.fs.s3a.path.style.access=true
121131
--conf spark.hadoop.fs.s3a.fast.upload=true
122-
132+
123133
--conf spark.shuffle.manager="org.apache.spark.shuffle.sort.S3ShuffleManager"
124134
--conf spark.shuffle.sort.io.plugin.class="org.apache.spark.shuffle.S3ShuffleDataIO"
125135
--conf spark.hadoop.fs.s3a.impl="org.apache.hadoop.fs.s3a.S3AFileSystem"

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") // https://github.com/sbt/sbt-assembly (MIT)
66
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") // https://github.com/sbt/sbt-buildinfo (MIT)
77
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1") // https://github.com/sbt/sbt-git (BSD-2-Clause)
8+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

0 commit comments

Comments
 (0)