From ad6015741551307bd4d04e547259ff725399ec8e Mon Sep 17 00:00:00 2001 From: JingZhang Chen Date: Tue, 23 Jan 2024 01:51:37 +0800 Subject: [PATCH 1/5] chore: mention the faster code fmt approach --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e2e4a422f9..4ddf8456c08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -171,6 +171,12 @@ sbt applyCodeStyle ``` +or you could format code via [Scala-Cli](https://scala-cli.virtuslab.org/), which can be improve the code format speed. + +```shell +Scala-cli fmt +``` + #### Do not use `-optimize` Scala compiler flag Pekko has not been compiled or tested with `-optimize` Scala compiler flag. (In sbt, you can specify compiler options in the `scalacOptions` key.) From 7b652150a046cede10c631e73abfe2de301dee14 Mon Sep 17 00:00:00 2001 From: "He-Pin(kerr)" Date: Tue, 23 Jan 2024 02:34:36 +0800 Subject: [PATCH 2/5] chore: Add Coursier cli for formatting --- CONTRIBUTING.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ddf8456c08..47e92f05727 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -171,10 +171,16 @@ sbt applyCodeStyle ``` -or you could format code via [Scala-Cli](https://scala-cli.virtuslab.org/), which can be improve the code format speed. +To format Scala code more faster, you could format code with [Scala-CLI](https://scala-cli.virtuslab.org/) or [Coursier CLI](https://scalameta.org/scalafmt/docs/installation.html#cli): +**With Scala-Cli** ```shell -Scala-cli fmt +scala-cli fmt +``` +**With Coursier CLI** +```Shell +cs install scalafmt +scalafmt --version # should be 3.7.17 ``` #### Do not use `-optimize` Scala compiler flag From 28e06a9bbb297b01ce289b02e8ef46043538da0b Mon Sep 17 00:00:00 2001 From: "He-Pin(kerr)" Date: Tue, 23 Jan 2024 02:44:02 +0800 Subject: [PATCH 3/5] chore: Remove the scalafmt version. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47e92f05727..acc796fb153 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -180,7 +180,7 @@ scala-cli fmt **With Coursier CLI** ```Shell cs install scalafmt -scalafmt --version # should be 3.7.17 +scalafmt ``` #### Do not use `-optimize` Scala compiler flag From fcc33173ba5ab40816746788c6546a33e67a77b7 Mon Sep 17 00:00:00 2001 From: "He-Pin(kerr)" Date: Tue, 23 Jan 2024 02:57:13 +0800 Subject: [PATCH 4/5] chore: Add notes about install scalafmt with cs. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index acc796fb153..f75312afb7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -179,7 +179,7 @@ scala-cli fmt ``` **With Coursier CLI** ```Shell -cs install scalafmt +cs install scalafmt // skip it if scalafmt is already installed. scalafmt ``` From 898cab618769b9ed1f3bce11ab19c73847c48796 Mon Sep 17 00:00:00 2001 From: JingZhang Chen Date: Tue, 23 Jan 2024 09:55:42 +0800 Subject: [PATCH 5/5] chore: mention binaries built --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f75312afb7b..dbf52b8075b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -179,7 +179,7 @@ scala-cli fmt ``` **With Coursier CLI** ```Shell -cs install scalafmt // skip it if scalafmt is already installed. +cs install scalafmt // skip it if scalafmt is already installed. If you are a macOS or Linux user, you can simply download the native binaries from the Coursier CLI installation page. scalafmt ```