Skip to content

Commit 1a85898

Browse files
committed
Add commands to apply and check codestyle
1 parent ff01e41 commit 1a85898

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ Example:
261261
* Details 2
262262
* Details 3
263263

264+
## Applying code style to the project
265+
266+
The project uses [scalafmt](https://scalameta.org/scalafmt/) to ensure code quality which is automatically checked on
267+
every PR. If you would like to check for any potential code style problems locally you can run `sbt checkCodeStyle`
268+
and if you want to apply the code style then you can run `sbt applyCodeStyle`.
269+
264270
### Ignoring formatting commits in git blame
265271

266272
Throughout the history of the codebase various formatting commits have been applied as the scalafmt style has evolved over time, if desired

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ commands := commands.value.filterNot { command =>
3131
ThisBuild / reproducibleBuildsCheckResolver :=
3232
"Apache Pekko Staging".at("https://repository.apache.org/content/groups/staging/")
3333

34+
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; headerCheckAll; javafmtCheckAll")
35+
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
36+
3437
inThisBuild(Def.settings(
3538
apiURL := {
3639
val apiVersion = if (isSnapshot.value) "current" else version.value

0 commit comments

Comments
 (0)