gofumpt icon indicating copy to clipboard operation
gofumpt copied to clipboard

#284 unconditionally remove leading and trailing lines from code blocks

Open davidmdm opened this issue 1 year ago • 6 comments

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.

davidmdm avatar Oct 10 '23 22:10 davidmdm

@mvdan Can you take a look at this?

davidmdm avatar Oct 11 '23 16:10 davidmdm

ive been using this pr for a while on some projects and it indeed works. =) Thanks @davidmdm

flan6 avatar Jan 17 '24 03:01 flan6

@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 avatar Jan 26 '24 16:01 davidmdm

@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 ._.

flan6 avatar Apr 01 '24 19:04 flan6

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.

davidmdm avatar Apr 02 '24 16:04 davidmdm

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

flan6 avatar Apr 04 '24 02:04 flan6