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

Regression in defaultWithAlign in 0.4.7 #531

Closed
RomanIakovlev opened this Issue Oct 18, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@RomanIakovlev
Contributor

RomanIakovlev commented Oct 18, 2016

Scalafmt 0.4.6 used to format code like this:

-"com.github.seratch" %% "awscala"                     % "0.5.7",
-"org.scalatest"      % "scalatest_2.11"               % "3.0.0" % Test,
-"org.scalamock"      %% "scalamock-scalatest-support" % "3.2.2" % Test,
-"org.mockito"        % "mockito-all"                  % "1.10.19" % Test,
-"com.josephpconley"  %% "play-jsonpath"               % "2.4.0" % Test,
-"com.typesafe.akka"  % "akka-testkit_2.11"            % "2.4.8" % Test,
-"org.elasticmq"      %% "elasticmq-rest-sqs"          % "0.9.3" % Test

Now 0.4.7 converts this to the following:

+"com.github.seratch" %% "awscala" % "0.5.7",
+"org.scalatest"     % "scalatest_2.11"               % "3.0.0"   % Test,
+"org.scalamock"     %% "scalamock-scalatest-support" % "3.2.2"   % Test,
+"org.mockito"       % "mockito-all"                  % "1.10.19" % Test,
+"com.josephpconley" %% "play-jsonpath"               % "2.4.0"   % Test,
+"com.typesafe.akka" % "akka-testkit_2.11"            % "2.4.8"   % Test,
+"org.elasticmq"     %% "elasticmq-rest-sqs"          % "0.9.3"   % Test

With the following settings:

maxColumn = 120
style = defaultWithAlign

Another example is:

-lazy val slf4j_api        = "org.slf4j"      % "slf4j-api"       % "1.7.21"
-lazy val junit            = "junit"          % "junit"           % "4.12" % Test
-lazy val mockito          = "org.mockito"    % "mockito-all"     % "1.10.19" % Test

+lazy val slf4j_api        = "org.slf4j" % "slf4j-api" % "1.7.21"
+lazy val junit            = "junit" % "junit" % "4.12" % Test
+lazy val mockito          = "org.mockito" % "mockito-all" % "1.10.19" % Test

Looks like a regression.

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Oct 18, 2016

Member

As explained on gitter

That seems to be a backlash from #525, I suspected the change might trigger some false negatives
I'm sure we can figure a way to solve those, for example by not counting infix applications towards the length to the root node.

Member

olafurpg commented Oct 18, 2016

As explained on gitter

That seems to be a backlash from #525, I suspected the change might trigger some false negatives
I'm sure we can figure a way to solve those, for example by not counting infix applications towards the length to the root node.

@olafurpg olafurpg closed this in 5fb7927 Oct 23, 2016

olafurpg added a commit that referenced this issue Oct 23, 2016

Merge pull request #549 from olafurpg/531
Infix applications to count towards valign depth, fixes #531
@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Oct 23, 2016

Member

This should be fixed now for this specific case. Please let me know if you find more regressions in the vertical alignment.

Member

olafurpg commented Oct 23, 2016

This should be fixed now for this specific case. Please let me know if you find more regressions in the vertical alignment.

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