Skip to content
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

Break before colon for massive return type #212

Closed
olafurpg opened this issue May 6, 2016 · 2 comments
Closed

Break before colon for massive return type #212

olafurpg opened this issue May 6, 2016 · 2 comments
Milestone

Comments

@olafurpg
Copy link
Member

olafurpg commented May 6, 2016

In order to fix #192 I need to come up with a better solution for massive return types. The solution I've come up with is to follow the Spark style guide: https://github.com/databricks/scala-style-guide#indent

Original:

<<< slick groupBy 2
  def groupBy[K, T, G, P](f: E => K)(implicit kshape: Shape[_ <: FlatShapeLevel, K, T, G], vshape: Shape[_ <: FlatShapeLevel, E, _, P]): Query[(G, Query[P, U, Seq]), (T, Query[P, U, Seq]), C, (T, Query[P, U, Seq]), (T, Query[P, U, Seq])]

Scalafmt:

def groupBy[K, T, G, P](f: E => K)(
    implicit kshape: Shape[_ <: FlatShapeLevel, K, T, G],
    vshape: Shape[_ <: FlatShapeLevel, E, _, P])
  : Query[(G, Query[P, U, Seq]),
          (T, Query[P, U, Seq]),
          C,
          (T, Query[P, U, Seq]),
          (T, Query[P, U, Seq])]

Note the newline before : Query[.... That newline previously came before the closing parenthesis ): Query[.... I suspect @sjrd will never approve this. So my suggestion is to add a configuration flag --allowNewlineBeforeColonInMassiveReturnTypes that's set to true in the default style and false in scalaJs.

Any objections?

@olafurpg olafurpg added this to the 0.2.3 milestone May 6, 2016
@densh
Copy link
Member

densh commented May 6, 2016

Looks fine to me.

@sjrd
Copy link

sjrd commented May 6, 2016

Configuration sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants