I will re-iterate, this is something large distributed development teams have struggled with for a long-time - it's my experience that diffs that ignore formatting changes and provide "contextual changes" are far easier to use - especially for code reviews.

If you are performing reviews using line by line diffs you're really missing out (and creating a lot more work).

If you ever used the Eclipse Java code changes review you'll know exactly what I mean.

-----Original Message-----
From: Manlio Perillo
Sent: Feb 20, 2020 4:53 PM
To: golang-nuts
Subject: Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

On Thursday, February 20, 2020 at 3:52:40 PM UTC+1, ohir wrote:
Dnia 2020-02-20, o godz. 08:57:51
David Riley <frave...@gmail.com> napisaƂ(a):

> I'm willing to be convinced otherwise.  [...]
> a new "magic" tab that won't be supported

This proposal is not about some "magic tab". It is about a gofmt formatting recipe
that allows for minimal changesets while keeping "pretty" autoformatting of structs
intact. ("Smart tabs" were mentioned by Manilo in other thread. :)


I proposed to use a tab in order for gofmt to recognize it and not reformat that field.
If we use a space, gofmt will not work correctly on existing code that is already formatted and should not be reformatted.

Maybe a better idea is to use a  U+00A0 NO-BREAK SPACE.  When gofmt see it, it should leave the formatting as is.
There is still the problem with older versions of gofmt if the code is also modified by others, and the fact that NO-BREAK-SPACE is not easy to input.
But gofmt may automatically insert it if it is used in the other fields.

> [...]

Manlio 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7d8a430a-b1d9-4d69-9814-0c8e39b3546f%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1457147623.3471.1582241006928%40wamui-lola.atl.sa.earthlink.net.

Reply via email to