Closed emdash-ie closed 1 year ago
The response on the linked issue has now clarified that --stdin
does not imply --stdout
– the help text was incorrect. Therefore this is no longer a workaround but a fix.
Good catch! Thanks for clearing up the issue with the scalafmt authors.
Glad to help :)
Sometimes, scalafmt does not produce formatted output to stdout with only the
--stdin
flag provided. For example, this happens when there are no formatting changes required to be made to the file. As-is, this causes the formatter to clear the buffer when there are no formatting changes required.As a workaround, adding the
--stdout
flag ensures that output is always put on stdout.See https://github.com/scalameta/scalafmt/issues/3632 for more information.