Re: [RFC] clang-format: outline the git project's coding style
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 12, 2017, 04:39 UTC
- Message-ID
- <xmqq378xxuvk.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170811211845.tpgmafenhahus77o@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> On Fri, Aug 11, 2017 at 10:52:37AM -0700, Brandon Williams wrote: > >> On 08/09, Stefan Beller wrote: >> > On Wed, Aug 9, 2017 at 3:53 PM, Stefan Beller <sbeller@google.com> wrote: >> > >> > > I would think based on these options, a pre commit hook can be >> > > written that formats precisely the touched lines of code of each file. >> > >> > I did not search enough, "clang-tidy-diff.py --fix" should be all that is needed >> >> I believe clang-tidy is different from clang-format am I mistaken? > > Yeah, I just dug in the archive. The script I ran way back when was > actually clang-format-diff.
I am confident with the competence of people around here that we can come up with a reasonable checker for obvious style violations. In the worst case, we could customize and/or tweak checkpatch.pl and start from there.
Assuming that we can have such a checker, I am more interested in the way how people envision such a checker fits in our workflow to help people. Earlier Dscho floated an idea to integrate with the GitHub pull requests in a way similar to how Travis and SubmitGit are triggered, and I can sort of see how it may help, but I haven't seen ideas from others.