Closed joeljuca closed 2 years ago
This is currently not supported by shfmt out of the box, but it's certainly doable if you modify its code. In particular, one could modify syntax.Printer
to not allow any empty lines at the start or end of a function body.
This is probably a good idea for shfmt in general, as I've implemented the same in https://github.com/mvdan/gofumpt.
@mvdan it would be nice to have it indeed. Unfortunately, I don't know much of Go, so I can't patch it, but I'm happy with what shfmt does already! It's a pretty nice tool - thank you for it!
Hi! This is more of a question than a bug or feature request. How could I force the removal of empty lines between the inner lines of a function?
For instance, the following function:
When formatted (with
shfmt -w hello.sh
), results in:I would like to force the removal of these empty lines at the beginning and ending of the function body, resulting in:
Is it currently possible with
shfmt
? :-)