Re: [RFC] clang-format: outline the git project's coding style
- Date: Wed, 9 Aug 2017 09:01:27 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: Re: [RFC] clang-format: outline the git project's coding style
On Mon, Aug 07, 2017 at 06:25:54PM -0700, Brandon Williams wrote:
> I'm sure this sort of thing comes up every so often on the list but back at
> git-merge I mentioned how it would be nice to not have to worry about style
> when reviewing patches as that is something mechanical and best left to a
> machine (for the most part). I saw that 'clang-format' was brought up on the
> list once before a couple years ago
> (https://public-inbox.org/git/20150121220903.GA10267@xxxxxxxx/) but nothing
> really came of it. I spent a little bit of time combing through the various
> options and came up with this config based on the general style of our code
> base. The big issue though is that our code base isn't consistent so try as
> you might you wont be able to come up with a config which matches everything we
> do (mostly due to the inconsistencies in our code base).
Right, the reason I stopped pursuing it was that I couldn't find a way
to have it make suggestions for new code without nagging about existing
code. If we were to aggressively reformat to match the tool for existing
code, that would help. But I'm a bit worried that there would always be
suggestions from the tool that we don't agree with (i.e., where the
guiding principle is "do what is readable").
I dunno. I guess "go fmt" people decided to just treat the tool's output
as the One True Way. I haven't written enough Go to have an opinion
myself, but it seems to at least work for them.
What does the tooling look like these days for just adjusting lines
touched by a given patch?