Closed panbingkun closed 1 month ago
When I was preparing to upgrade scalafmt
from 3.8.2
to 3.8.3
in Spark
repo, I found the above problem. The command is as follows:
./build/mvn scalafmt:format -Dscalafmt.skip=false -Dscalafmt.validateOnly=false -Dscalafmt.changedOnly=false -pl sql/connect/common -pl sql/connect/server -pl connector/connect/client/jvm
could you please edit your submission to make it more readable? not sure why you decided to retain all of the issue submission template, including text intended to describe what we're asking of you, and not the other way around.
When I was preparing to upgrade
scalafmt
from3.8.2
to3.8.3
inSpark
repo, I found the above problem. The command is as follows:./build/mvn scalafmt:format -Dscalafmt.skip=false -Dscalafmt.validateOnly=false -Dscalafmt.changedOnly=false -pl sql/connect/common -pl sql/connect/server -pl connector/connect/client/jvm
the original template, the one you kept in its entirety but didn't really follow, explains that you can't submit issues here unless you run the cli tool from this repository. if you use a maven plugin, feel free to report it to that plugin's maintainers instead.
Let me update it.
(base) ➜ spark-trunk git:(master) ✗ scalafmt --version
scalafmt 3.8.3
(base) ➜ spark-trunk git:(master) ✗ scalafmt -c dev/.scalafmt.conf sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala
(base) ➜ spark-trunk git:(master) ✗ git diff
Sorry, this is my first time submitting an issue to this repo, but it is indeed a issue.
I have updated the description of this PR and it is normal in version 3.8.2
.
However, in the latest version 3.8.3
, there is the aforementioned issue.
Configuration (required)
Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt -c dev/.scalafmt.conf sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala
See the file here: https://github.com/apache/spark/blob/e1b5d65aeeccd2d724b753fc6f2132086825bef9/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Note: Obviously, the number of columns after formatting greatly exceeds the limit
Expectation
I would like the formatted output to look like this:
Workaround
Notes
the version
3.8.2
is normal, but the version3.8.3
is abnormal.