Skip to content

Commit 8e9e39f

Browse files
authored
Merge pull request #1952 from arbitrary-dev/arbitrary-dev/consistent-formatting
2 parents b1869af + 90a5f74 commit 8e9e39f

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

_style/declarations.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,32 @@ There are three main reasons you should do this:
224224
List("").foldLeft[Int](0, _ + _.length)
225225

226226
For complex DSLs, or with type-names that are long, it can be difficult
227-
to fit the entire signature on one line. In those cases, align the
228-
open-paren of the parameter lists, one list per line (i.e. if you can't
229-
put them all on one line, put one each per line):
227+
to fit the entire signature on one line. For those cases there are several
228+
different styles in use:
229+
230+
1. Split the parameter lists, one parameter per line with
231+
[trailing commas](https://docs.scala-lang.org/sips/trailing-commas.html#motivation)
232+
and parentheses being on separate lines adding to visual separation between
233+
the lists:
234+
235+
protected def forResource(
236+
resourceInfo: Any,
237+
)(
238+
f: (JsonNode) => Any,
239+
)(implicit
240+
urlCreator: URLCreator,
241+
configurer: OAuthConfiguration,
242+
): Any = {
243+
...
244+
}
230245

231-
protected def forResource(resourceInfo: Any)
232-
(f: (JsonNode) => Any)
233-
(implicit urlCreator: URLCreator, configurer: OAuthConfiguration): Any = {
234-
...
235-
}
246+
2. Or align the open-paren of the parameter lists, one list per line:
247+
248+
protected def forResource(resourceInfo: Any)
249+
(f: (JsonNode) => Any)
250+
(implicit urlCreator: URLCreator, configurer: OAuthConfiguration): Any = {
251+
...
252+
}
236253

237254
#### Higher-Order Functions
238255

0 commit comments

Comments
 (0)