Skip to content

Commit 3b1d396

Browse files
committed
Add sbt alias to run both scalafmt & scalafix
Also update github ci & readme
1 parent 0e1d778 commit 3b1d396

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
run: sbt test
2121

2222
- name: Check Formatting
23-
run: sbt scalafmtCheckAll
23+
run: sbt check

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Lila websocket
2+
23
Handle incoming websocket traffic for [lichess.org](https://lichess.org).
34

45
```
@@ -28,9 +29,4 @@ Trusts `X-Forwarded-For`. Use only behind a reverse proxy!
2829

2930
### Code formatting
3031

31-
This repository uses [scalafmt](https://scalameta.org/scalafmt/).
32-
33-
Please [install it for your code editor](https://scalameta.org/scalafmt/docs/installation.html)
34-
if you're going to contribute to this project.
35-
36-
If you don't install it, please run `scalafmtAll` in the sbt console before committing.
32+
Please `sbt prepare` before you submit a PR. This will reformats and do some auto refactoring the code.

build.sbt

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ lazy val `lila-ws` = project
2727
libraryDependencies ++= Seq(
2828
("org.reactivemongo" %% "reactivemongo" % "1.1.0-RC12")
2929
.exclude("org.scala-lang.modules", "scala-java8-compat_2.13"),
30-
"org.reactivemongo" % s"reactivemongo-shaded-native-$os-$arch" % "1.1.0-RC12",
31-
"io.lettuce" % "lettuce-core" % "6.3.1.RELEASE",
32-
"io.netty" % "netty-handler" % nettyVersion,
33-
"io.netty" % "netty-codec-http" % nettyVersion,
34-
("io.netty" % s"netty-transport-native-epoll" % nettyVersion)
30+
"org.reactivemongo" % s"reactivemongo-shaded-native-$os-$arch" % "1.1.0-RC12",
31+
"io.lettuce" % "lettuce-core" % "6.3.1.RELEASE",
32+
"io.netty" % "netty-handler" % nettyVersion,
33+
"io.netty" % "netty-codec-http" % nettyVersion,
34+
("io.netty" % s"netty-transport-native-epoll" % nettyVersion)
3535
.classifier(s"linux-$arch_"),
3636
("io.netty" % s"netty-transport-native-kqueue" % nettyVersion)
3737
.classifier(s"osx-$arch_"),
@@ -50,17 +50,24 @@ lazy val `lila-ws` = project
5050
"com.roundeights" %% "hasher" % "1.3.1",
5151
"org.scalameta" %% "munit" % "1.0.0-M11" % Test
5252
),
53-
scalacOptions := Seq(
54-
"-encoding",
55-
"utf-8",
56-
"-rewrite",
57-
"-source:future-migration",
58-
"-indent",
59-
"-explaintypes",
60-
"-feature",
61-
"-language:postfixOps",
62-
"-Xtarget:21",
63-
"-Wunused:all"
64-
),
65-
javaOptions ++= Seq("-Xms32m", "-Xmx256m")
53+
scalacOptions := Seq(
54+
"-encoding",
55+
"utf-8",
56+
"-rewrite",
57+
"-source:future-migration",
58+
"-indent",
59+
"-explaintypes",
60+
"-feature",
61+
"-language:postfixOps",
62+
"-Xtarget:21",
63+
"-Wunused:all"
64+
),
65+
javaOptions ++= Seq("-Xms32m", "-Xmx256m")
66+
)
67+
68+
69+
addCommandAlias("prepare", "scalafixAll; scalafmtAll")
70+
addCommandAlias(
71+
"check",
72+
"; scalafixAll --check ; scalafmtCheckAll",
6673
)

0 commit comments

Comments
 (0)