Skip to content
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

CLI: Only print changed files #678

Closed
nex3 opened this issue Mar 21, 2018 · 6 comments
Closed

CLI: Only print changed files #678

nex3 opened this issue Mar 21, 2018 · 6 comments

Comments

@nex3
Copy link
Member

nex3 commented Mar 21, 2018

Right now, when running the formatter from the command-line on a large package, it prints a line for each file it looks at, whether or not that file was changed. This produces a lot of noise for very little information, and makes it very hard to see which files actually did change—or worse, whether a file had a syntax error. It would be much easier to understand if it only printed files that were reformatted or failed to parse.

@munificent
Copy link
Member

Yeah, I'd like to do this too.

@natebosch
Copy link
Member

Similar to #715

Maybe -q for "only changed files" and -qq for "completely silent"?

@cclauss
Copy link

cclauss commented Oct 14, 2020

Is this issue fixed?

@munificent
Copy link
Member

Yes, the new CLI you get using dart format (as opposed to dartfmt) only prints changed files by default.

@nex3
Copy link
Member Author

nex3 commented Oct 20, 2020

Is there a way to access that CLI for a specific version of the formatter? In Dart Sass, we run the formatter both from the CLI and from dart_style's Dart API, and we need to make sure we're using the same version of each of these so we get the same formatting.

@munificent
Copy link
Member

Is there a way to access that CLI for a specific version of the formatter?

No, the new CLI isn't directly exposed by dart_style, only through dart format. It wouldn't be too much trouble to add another entrypoint to do that, but I was trying to avoid increasing the surface area I need to support so didn't. So that means you always get whatever version of dart_style was bundled with the version of the Dart SDK you run dart format from.

we need to make sure we're using the same version of each of these so we get the same formatting.

I'm guessing you used pub run to run it? If you want to run the formatter from a dependency on dart_style, you're probably better off still using the old CLI, which is still supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants