gofumpt
gofumpt copied to clipboard
#284 unconditionally remove leading and trailing lines from code blocks
This implements as far as I can tell, the change needed for this issue.
Unclear as to how where tests live at this time, but running go test ./...
seems to still be working.
@mvdan Can you take a look at this?
ive been using this pr for a while on some projects and it indeed works. =) Thanks @davidmdm
@flan6 I would love this to be merged so that we can get it integrated into gopls. I have to build my own branch of gopls to get the automatic formatting behavior that I want :(
@davidmdm hi! have you seen what @mvdan said about this pr on issue #284? I'm not sure if you should do it or me ._.
Hi @flan6,
I saw it, however I don't have the bandwidth personally to figure out how to do the look ahead to figure out if the block precedes an if-else or else block.
Also, personally, I prefer the current behaviour where all blocks are pruned of newlines.
These things combined mean that I haven't had the time or motivation to address @mvdan's review.
If you're able to carry it through that would be great. Otherwise I'll try and get to it eventually but it won't necessarily be in the next month or so.
Also, personally, I prefer the current behaviour where all blocks are pruned of newlines.
I see, and I agree with you about the rule. But nonetheless it is a great improvement over what it was before. And I am very grateful for your effort so far! I'll try to carry it on and achieve what mdvan requested and i will surely let you know about the outcome!
Again, thank you so much