-
Notifications
You must be signed in to change notification settings - Fork 38
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
A --check
flag that won't actually apply the formatting but only tell us if some files need formatting and if possible, the list of those
#500
Comments
There isn't really a uniform approach for I'd like to understand better why mutating the files in CI is an issue for you. |
I wasn't aware of this fact. All formatters I used to date always provided some option (usually
Our approach is that the CI reuse the same logic as the local developer through a In the meantime, we need to manually call individual formatters in our |
I'll dig into this a bit more over the holidays. @zimbatm @jfly I'd like your take as well. A simple pass-through is possible if On a related note though, this sounds like what treefmt-nix already has some plumbing for. It adds a flake check which fails and produces a diff if there were changes (within a nix build, so it doesn't touch the local filesystem). Could that be of use in this instance @jraygauthier ? |
Thanks for the ref, I wasn't aware it was available. Will have a look. |
Same behavior as any formatter's
--check
flag. If the formatter does not provide a--check
flag, the formatting could be done to a temp location and a diff helper could be used to check if there are differences.Same reason why
--check
mode is needed for formatter. I don't want my CI to mutate the files (which is the current behavior of the--ci
flag).The text was updated successfully, but these errors were encountered: