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
Scala class definitions are often over 100 chars, so it'll be useful to give some clear guidance. The purpose of this issue is to clarify the whitespace guidelines for the different scenarios. Once that's clarified, I'll update the style guide with a PR detailing the scenarios.
Thanks again for making this style guide. It's been incredibly helpful over the years.
Scenario 1: When possible, put everything on one line
classBar(valparam1:String) extendsBarInterface
Scenario 2: (params + traits) > 100 chars
The style guide currently has this:
classFoo(
valparam1:String, // 4 space indent for parametersvalparam2:String,
valparam3:Array[Byte])
extendsFooInterface// 2 space indent herewithLogging {
deffirstMethod():Unit= { ... } // blank line above
}
Here's the formatting I'm actually seeing in the Spark codebase:
Scala class definitions are often over 100 chars, so it'll be useful to give some clear guidance. The purpose of this issue is to clarify the whitespace guidelines for the different scenarios. Once that's clarified, I'll update the style guide with a PR detailing the scenarios.
Thanks again for making this style guide. It's been incredibly helpful over the years.
Scenario 1: When possible, put everything on one line
Scenario 2: (params + traits) > 100 chars
The style guide currently has this:
Here's the formatting I'm actually seeing in the Spark codebase:
Here's some actual Spark code:
Seems like the style guide is suggesting we should break up
SubtractTimestamps
to 6 lines. I like the 2 line formatting personally.Scenario 3: params > 100 chars and traits > 100 chars
Here's another actual Spark class:
Is the rule "when the traits > 100 chars, then they should all be put on a newline with 2 space indentation"? e.g. is this the desired formatting?
Or do we want this?
Scenario 4: params < 100 chars and traits > 100 chars
Is this the correct formatting?
Or is it like the params - whenever the traits > 100 chars, then each trait needs to be broken out on a newline.
Thank you for the help!
The text was updated successfully, but these errors were encountered: