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

format --check just formats your code #588

Closed
ckipp01 opened this issue Jan 28, 2022 · 3 comments
Closed

format --check just formats your code #588

ckipp01 opened this issue Jan 28, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@ckipp01
Copy link
Contributor

ckipp01 commented Jan 28, 2022

Version(s)

0.10.0

Describe the bug

When trying to check your sources for formatting with scala-cli --check it just formats your code.

To Reproduce

If you have some code like this

//> using scala "3.1.1"

@main def Main(args: String*): Unit =
            throw new Exception

A format file like this

version = "3.3.3"
runner.dialect = scala3

And you run scala-cli --check it just formats your code.

Expected behaviour
I'd expect this to behave exactly like it does with scalafmt. For example on the same code when I try scalafmt cli I get:

❯ scalafmt --check
--- a/Users/ckipp/Documents/scala-workspace/scala-cli-test/Main.scala
+++ b/Users/ckipp/Documents/scala-workspace/scala-cli-test/Main.scala
@@ -3,2 +3,2 @@
 @main def Main(args: String*): Unit =
-            throw new Exception
+  throw new Exception
error: --test failed

The output of scala-cli format --check should be the same.

@romanowski romanowski added the bug Something isn't working label Jan 28, 2022
@romanowski romanowski added this to To do in Issue Board Jan 28, 2022
@romanowski
Copy link
Member

--check is broken for Scala 2 and default scalafmt config - basically it is not implemented properly on our side.

@ckipp01
Copy link
Contributor Author

ckipp01 commented Jan 28, 2022

--check is broken for Scala 2 and default scalafmt config - basically it is not implemented properly on our side.

Ahh sorry I didn't realize this was a duplicate!

@romanowski
Copy link
Member

Do not worry, your report is much more detailed ;)

@jchyb jchyb self-assigned this Jan 31, 2022
@jchyb jchyb closed this as completed in 868e6b3 Feb 1, 2022
@lwronski lwronski moved this from To do to Done in Issue Board Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants