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
I'm working a lot with Spark struct types. It's apply method takes a single collection parameter and I'd like to find a way to keep a collection type name on the same line with a StructType. Is there any possibility to do it?
The text was updated successfully, but these errors were encountered:
I tried it, but unfortunately, newlines.source=fold is too "greedy" to me. It transforms the following piece:
val schema = StructType(Seq(
StructField("fieldA", DataTypes.StringType),
StructField("fieldB", DataTypes.StringType)
))
into the following (single line):
val schema =
StructType(Seq(StructField("fieldA", DataTypes.StringType), StructField("fieldB", DataTypes.StringType)))
In my config I have newlines.source = keep and I'm satisfied with it in most cases. This is the only thing which I'd like to change and I was not sure that I did not miss some option which can help me. But this is not critical I can live with a current implementation if it's impossible to change it somehow.
This template is a guideline, not a strict requirement.
Steps
Given code like this:
When I run scalafmt like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
Workaround
Not found. Looking for it.
Notes
I'm working a lot with Spark struct types. It's
apply
method takes a single collection parameter and I'd like to find a way to keep a collection type name on the same line with aStructType
. Is there any possibility to do it?The text was updated successfully, but these errors were encountered: