-
Notifications
You must be signed in to change notification settings - Fork 2k
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 fish_indent --check #7251
Comments
I don't see the benefit? Why not just reformat? |
Here's a popular formatter with a As they said above, I'm interested in using this in a CI pipeline. With linters and formatters as part of the pipeline, I'd prefer that the commit remains unchanged. |
I mean you can also just use it in the pre-commit hook, or write that thing above. The way fish_indent is written would make this quite difficult, because it doesn't actually look at the source. It looks at the parse tree. |
Okay, no, this is much easier than I assumed. |
Yeah, added. However fish_indent had some rather annoying regressions since 3.1.2, see #7252. |
Thanks for the quick response and feature addition @faho 😄 |
Hi @faho Sorry to bother you about this issue again😕, I really appreciate you adding it 😄. I should have thought of this in the original issue:
|
Also return the number of failed files. I decided to *just* print the filenames (newline-separated because NULLs are annoying here) to make it easier to deal with. See #7251.
Yeah, sure, done. It now returns the number of failed files and prints newline-separated names of the failed files (this also means it doesn't quit at the first failure - which is usually a bad idea anyway). |
Similarly to many other formatters,
fish_indent
should have a-c/--check
option that will tell the user if the fish file is formatted asfish_indent
would like.This is currently achievable with
fish_indent $file | diff - $file
, but I think it should be added as a standard option.fish, version 3.1.2
Linux archlabs 5.7.12-arch1-1 #1 SMP PREEMPT Fri, 31 Jul 2020 17:38:22 +0000 x86_64 GNU/Linux
xterm-256color
Clean fish
The text was updated successfully, but these errors were encountered: