You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,8 @@ In general:
191
191
}
192
192
```
193
193
194
-
- For method declarations, use 4 space indentation for its parameters when they don't fit in a single line. Return types can be either on the same line as the last parameter, or put to next line with 2 space indent.
194
+
- For method declarations, use 4 space indentation for their parameters and put each in each line when the parameters don't fit in two lines. Return types can be either on the same line as the last parameter, or start a new line with 2 space indent.
- For classes whose header doesn't fit in a single line, put the extend on the next line with 2 space indent, and add a blank line after class header.
217
+
- For classes whose header doesn't fit in two lines, use 4 space indentation for its parameters, put each in each line, put the extends on the next line with 2 space indent, and add a blank line after class header.
218
+
217
219
```scala
218
220
classFoo(
219
221
valparam1:String, // 4 space indent for parameters
@@ -226,6 +228,22 @@ In general:
226
228
}
227
229
```
228
230
231
+
- For method and class constructor invocations, use 2 space indentation for its parameters and put each in each line when the parameters don't fit in two lines.
232
+
233
+
```scala
234
+
foo(
235
+
someVeryLongFieldName, // 2 space indent here
236
+
andAnotherVeryLongFieldName,
237
+
"this is a string",
238
+
3.1415)
239
+
240
+
newBar(
241
+
someVeryLongFieldName, // 2 space indent here
242
+
andAnotherVeryLongFieldName,
243
+
"this is a string",
244
+
3.1415)
245
+
```
246
+
229
247
- Do NOT use vertical alignment. They draw attention to the wrong parts of the code and make the aligned code harder to change in the future.
0 commit comments