scala-style-guide
scala-style-guide copied to clipboard
Synchronized definitions which exceed 100 columns
Consider the first line of an implementation method like this:
| <- 100 columns
override def moveObject(audit: AuditInfo, source: String, destination: String): Unit = synchronized {
Is the appropriate style to change this to something like
| <- 100 columns
override def moveObject(audit: AuditInfo, source: String, destination: String): Unit = {
synchronized {
or
| <- 100 columns
override def moveObject(audit: AuditInfo, source: String, destination: String): Unit =
synchronized {
If we remove the outermost block, the inner indentation level will be one stop closer to the left margin.
I think either could work. No strong opinion here.
I consider the first slightly preferable for the same reason why we prefer braces around defs which are not one-liners.