Boost logo

Boost :

Subject: Re: [boost] [hana] missing .gitattributes
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-02-26 18:09:52

On 25 Feb 2016 at 22:32, Louis Dionne wrote:

> > Whilst doing a crlf conversion I'd also recommend a round of
> > clang-format, gets all the changes done at once. Add clang format to
> > your CI after that to keep your source code looking nice.
> I tried setting up clang-format, but I could never get it to do exactly
> what I wanted. It always changes stuff that I don't want it to, so I
> eventually gave up.

You're not wrong that most of clang-format's value is for enforcing a
consistent style when multiple people are modifying the code over
time. That's not so much the case for Hana right now, but in a few
years you'll be seeing a lot of pull requests from others etc and
some people really mangle what they send you for review making it
much harder to grok. clang format is therefore gold for when a
library matures.

That said, I installed the experimental "always on" clang format
plugin for VS2015 recently which applies clang format every save for
you live in the IDE. As I hit save a lot during coding, this lets me
fix up any unhelpful reformats as I go. It's not bad if you're
building a codebase from scratch as I am with AFIO v2, I think I'll
be keeping it permanently as it's fire and forget, and makes things
like tab issues go away forever.

Essentially I think clang format useful for mature code and brand new
code. It's not particularly useful for anything in between, if
anything it costs me more typing than it saves me :)


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at