Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions _style/declarations.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -224,15 +224,32 @@ There are three main reasons you should do this:
List("").foldLeft[Int](0, _ + _.length)

For complex DSLs, or with type-names that are long, it can be difficult
to fit the entire signature on one line. In those cases, align the
open-paren of the parameter lists, one list per line (i.e. if you can't
put them all on one line, put one each per line):
to fit the entire signature on one line. For those cases there are several
different styles in use:

1. Split the parameter lists, one parameter per line with
[trailing commas](https://docs.scala-lang.org/sips/trailing-commas.html#motivation)
and parentheses being on separate lines adding to visual separation between
the lists:

protected def forResource(
resourceInfo: Any,
)(
f: (JsonNode) => Any,
)(implicit
urlCreator: URLCreator,
configurer: OAuthConfiguration,
): Any ={
...
}

protected def forResource(resourceInfo: Any)
(f: (JsonNode) => Any)
(implicit urlCreator: URLCreator, configurer: OAuthConfiguration): Any ={
...
}
2. Or align the open-paren of the parameter lists, one list per line:

protected def forResource(resourceInfo: Any)
(f: (JsonNode) => Any)
(implicit urlCreator: URLCreator, configurer: OAuthConfiguration): Any ={
...
}

#### Higher-Order Functions

Expand Down