Skip to content

Add consistency to parameter lists formatting #1805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 14 additions & 7 deletions _style/declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,20 @@ 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):

protected def forResource(resourceInfo: Any)
(f: (JsonNode) => Any)
(implicit urlCreator: URLCreator, configurer: OAuthConfiguration): Any = {
to fit the entire signature on one line. In those cases, 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 a separate lines adding to visual separation between
lists:

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

Expand Down