Using --stdin
(without --stdout
) sometimes does not cause formatted output to go to stdout
#3632
Closed
1 task done
.scalafmt.conf
Configuration (required)
Please paste the contents of your
.scalafmt.conf
file here:Steps
Given Something.scala:
Running
scalafmt --debug Something.scala
produces this output and the file does not change (as expected):Running
scalafmt --debug --stdout Something.scala
produces this output and the file does not change (as expected):Running
cat Something.scala | scalafmt --debug --stdin --stdout
produces this output and the file does not change (as expected):Based on the help documentation (which says
scalafmt --stdin # read from stdin and print to stdout
) I would expect removing--stdout
to make no difference, but runningcat Something.scala | scalafmt --debug --stdin
produces the following output and the file does not change.Why is the file not output onto stdout in this case? (This happens when the file is correctly formatted, and mostly doesn’t happen (or never happens – not sure) if the file needs formatting.)
Workaround
I can add the
--stdout
flag (and raise a PR to do that informat-all-mode
).Notes
The text was updated successfully, but these errors were encountered: