From 01ad4620ecb165fcfe28ac6e87098384fcd0fa87 Mon Sep 17 00:00:00 2001 From: kerr Date: Mon, 18 Jan 2021 20:03:22 +0800 Subject: [PATCH] Add more comments about formatting. (#29001) --- CONTRIBUTING.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ef1628a52..53aba98267 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -169,6 +169,33 @@ akka-cluster/scalafmtAll akka-persistence/scalafmtAll ``` +To format the Java source code: +``` +sbt +project akka-actor +javafmtAll +``` + +To keep the *import*s sorted with: + +``` +sbt +project akka-actor +sortImports +``` + +To verify code style with: +``` +sbt +verifyCodeStyle +``` + +To apply code style with: +``` +sbt +applyCodeStyle +``` + ### Do not use `-optimize` Scala compiler flag Akka has not been compiled or tested with `-optimize` Scala compiler flag. (In sbt, you can specify compiler options in the `scalacOptions` key.) @@ -430,6 +457,8 @@ not needed to use `sbt scalafmtAll` when editing with IntelliJ. PR validation includes checking that the Scala sources are formatted and will fail if they are not. +It's recommended to run `sbt +sortImports` to keep the *import*s sorted. + ### Java style Akka uses [the sbt Java Formatter plugin](https://github.com/sbt/sbt-java-formatter) to format Java sources.