-
Notifications
You must be signed in to change notification settings - Fork 114
proposal: use shfmt for shell files #557
Comments
Yes. That is for consistency with other redirects, like |
Is there a "standard" about that triple redirect formatting? I'm asking because this particular change breaks color syntax in my editor (sublime text). Color seems however fine in vim. |
Not really. |
Well, bug or not, that is a bummer for me :/ |
Have you filed an issue about this? I would file one, but I've never used Sublime - you're probably the better person to do that. https://github.com/sublimehq/Packages is probably the place from a quick look around. |
I didn't. You are the better person to file a bug, since this impact your software. I might include some of the other modifications, but until then this is kinda useless to me. |
I've opened an issue for now. |
I've recently written shfmt, the equivalent of gofmt for bash/shell programs. pacaur is pretty active and has lots of contributors, so I think it would benefit from its use.
More info: https://github.com/mvdan/sh
I've tagged a release and uploaded binaries, if that makes testing or integration with CI easier: https://github.com/mvdan/sh/releases/tag/v0.1.0
I ran
shfmt -l -w -i 4 .
and these are the diffs. This does all the files that either have a bash/shell extension or have no extension and a valid bash/shell shebang.By default it indents with tabs, but it can also use any number of spaces. For now, nothing else is configurable, and I hope to keep it that way. I've used four spaces since that's what you guys seem to use.
git diff
- https://clbin.com/tecrTgit diff -w
- https://clbin.com/1GlVpIf you have any questions or issues, I'm happy to help.
The text was updated successfully, but these errors were encountered: