-
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
scalafmt
3.9.0 doesn't format code with minimal configuration
#4827
Comments
the test cases are here: not sure if it's the same thing as #4825 |
Looks like the 3.9.0 runner doesn't do anything currently. Running with 3.8.6 runner and new version set does work. |
That would explain it, since Scala CLI downloads the runner associated with the version. |
@Gedochao the issue you are reporting is with scala-cli, not scalafmt, correct? and what you are observing is that the way scala-cli uses scalafmt doesn't work, would that be accurate? 3.9.0 CLI is not perfect (reads a lot of files first before starting to format, and does not exit if there are exceptions) but it does format. at least in my testing. so, perhaps, the way to use it in scala-cli should change, now that scalafmt is asynchronous? |
No. I can replicate the issue with the @kitbellew note that if you use an older What Scala CLI does is it downloads the launcher matching the |
How, specifically? Without scala-cli, preferably.
Clearly, I used the actual 3.9.0, coursier-installed and also locally built, via |
what do you mean by "launcher"? do you mean the scalafmt-cli package or something else? and what do you mean by "runs that"? do you run it by creating a new process and running the executable above? or are you loading the jar and invoking the |
For me what I did was: After doing |
@tgodzik I did the same :( in this repository, specifically, I added some spaces here and there and ran the coursier-installed scalafmt. And it worked. Which repo did you use? What's the config file there? Are there any files which cannot be formatted (bad scala or search state exploding etc.)? |
Huh, the file was very simple:
I can try and dig in tomorrow to see what is going on. |
@kitbellew |
Looks to be working both native image and Scala native. Thanks! |
Required: Configuration
Required: Command-line parameters
none
Steps
Given code like this:
Problem
Scalafmt 3.9.0 formats code like this (as in, seemingly not at all):
Expectation
I would like the formatted output to look like this (3.8.6 and before did so):
Notes
Even when setting the version to 3.8.6 in the configuration, using the newest
scalafmt-cli
launcher (3.9.0) seems to not format the code.Discovered while bumping
scalafmt
inscala-cli
:The text was updated successfully, but these errors were encountered: