Do you have any info on what I could use to make the command-line “git diff” and “git rebase” handle this style of formatting? Ideally so the latter merges and produces code which matches “gofmt” output?
On the other hand I suppose my point is that even if there were such tooling, using style of formatting doesn’t offer enough (any?) benefit to justify the effort of introducing the tooling.
1/ always have pre-commit hooks running lint/fmt, and document how to implement them in a common fashion in the team,
2/ strive to follow the language conventions (and if not, have those divergences explicitly defined in the linter/formatter tool configuration), this helps the team to align with it,
3/ having a job server-side that blocks merging PRs that do not pass both of these steps.
But that doesn't help when you do "git rebase" and there's a large conflict which you have to resolve manually, caused by two people changing different lines, and one or both of those lines caused the formatting of the whole block to change. That's the source of my frustration.
elzbardico•4w ago
I Absolutely love how the use of white space makes things more readable.
adrianmsmith•4w ago
https://github.com/gohugoio/hugo/blob/master/commands/comman...
Even if there were readability benefits, I’m not sure they’d be enough to offset the extra effort in reviewing, diffing and merging.