-
Notifications
You must be signed in to change notification settings - Fork 279
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
scalafmtCheck not accepting formatted code #1231
Comments
Thanks for reporting! I am unable to reproduce, I tried both with the cli and sbt plugin. Can you please update https://github.com/olafurpg/repro-scalafmt/blob/master/src/main/scala/Issue1231.scala with an input that reproduces the issue? |
This was hard to find out: running When running it twice in different sbt sessions, my whole project passes the checks. |
This idempotency violation has been fixed as of scalameta#1262 see scalameta#1231
I took a stub at this issue and found that these regressions are caused by idempotency violations (not an issue of sbt-scalafmt)
The cause of this phenomenon is an idempotency violation and sbt. By the way, I tried to fix the violations reported in #1231 (comment)
and got the following diff
I know the redundant indentations are caused by
P( ... ) which has too long columns add redundant indentation indentation on case x => Page() and } ), but the logic for caluculating the indentation is too complicated for me to fix the idempotency violation without breaking other test cases...As #1278 (review), we may we want to invest our efforts in #917 |
Is this still present in 2.0.0-RC4? |
@dwijnand 2.0.0-RC4 of what? |
Scalafmt |
Indeed I didn't notice that 2.x RC series were out. |
I just run into it with plugin in version |
Is it still actual? I can't reproduce |
Not sure, I'm not using scalafmt at the moment. And if you can't reproduce, it might be a sign that this issue is fixed. :) |
(default configuration)
In my sbt project I have several (heavily reduced) scala-files. When I run
scalafmt
and thenscalafmtCheck
, These files get reported as not being properly formatted. The second one only gets reported after the first one is changed to be properly formatted.Shortening the string makes this one work.
Removing the comment makes this one work.
Do you need more examples?
The text was updated successfully, but these errors were encountered: