-
Notifications
You must be signed in to change notification settings - Fork 278
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
Add --list
option that outputs names of files changed
#1459
Comments
It would be nice for scalafmt to list all the formating files (if scalafmt receives the list of files to format) without any options 👍 |
Not sure if I understand: so if run If I just run: I'm not sure if you mean the outputs to be:
? |
|
That would be useful debugging info, but would not help my use case - I'd like to see the files that changed (when running without Maybe there should be two flags: |
Also strong want this, and suspect my use case is the same as @ArturGajowy -- I want a list of all files that "would be re-formatted". In my case, it's because we want to run this in CI, and warn if a file was not scalafmt'd. The standard "diff" format is useful for writing changes to a file, but not as an error message. For comparison, similar options with other formatters:
In the case of Prettier, you then get output such as:
This is a much nicer error message to give someone in a failed CI check than dumping many screens of diffs. |
Ah, finally I got it. |
Closed by #1466 👍 |
As requested in scalameta/scalafmt#1459, and introduced in scalameta/scalafmt#1466, which was release in v2.0.1 which we pinned to in previous commit. Yay!
Currently, running:
scalafmt Foo.scala
on a non-formatted file outputs:
I'd expect it to list all the files that were changed during reformatting, or provide an option to do so.
Similarly, running:
scalafmt --test Foo.scala
will output the diffs of files needing formatting - but ideally there'd be an option to just list the names.
The text was updated successfully, but these errors were encountered: