<div dir="ltr"><div>1) We don't change the defaults between versions</div><div>2) Any formatting changes caused between versions are either from</div><div>        a) bug fixes</div><div>        b) regressions</div><div><br></div><div>I'd like to think 2b) doesn't happen but we have to be realistic. It does, but it's why I don't like letting people change existing unit tests in a review.</div><div><br></div><div>New features could potentially change things as we try to pick a new default, </div><div><br></div><div>but mostly changes could be because clang-format miss identified a  correct sequences of tokens (BinaryOperator vs PointerOrReference being a particular pain point)</div><div><br></div><div>FWIW, I run a multi million line project, we run the bleeding edge, last released version, each release of Clang-Format I have maybe 10-20 files to change. If I left it 5 or so releases I'm sure the impact would seem greater.</div><div><br></div><div>We check on CI and nightly builds (with -n option) and report out as warnings so they get fixed pretty quickly.</div><div><br></div><div>If you are worried about git blame see (<a href="https://akrabat.com/ignoring-revisions-with-git-blame/">https://akrabat.com/ignoring-revisions-with-git-blame/</a>)</div><div><br></div><div>My 2c worth</div><div><br></div><div>MyDeveloperDay</div><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 10, 2021 at 12:32 PM Ben Boeckel via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Aug 10, 2021 at 13:13:09 +0200, Manuel Klimek via cfe-dev wrote:<br>
> clang-format is designed to run on changed lines, not to have all code be<br>
> compliant. You can use it for the latter, but I think it's a pretty<br>
> fundamental difference in development goals.<br>
<br>
The problem I've seen is that the opinion of code formatted with 3 lines<br>
of context can differ from 5 lines of context which can be still<br>
different again given the entire file. The only reliable way we've<br>
gotten it to work is to format the whole file every time. But we require<br>
well-formatted code via CI processes, so that's fine (if one can afford<br>
the "rewrite the world" every time the tool gets updated…hence why some<br>
projects are still on version 3.8(!), others 6, some even made it to 9).<br>
<br>
--Ben<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>