Add more comments about formatting. (#29001)

This commit is contained in:
kerr 2021-01-18 20:03:22 +08:00 committed by GitHub
parent c83b57674f
commit 01ad4620ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.