<div dir="ltr"><div>To illustrate another workflow:</div><div dir="ltr">I also got format-on-save turned on, but filter the irrelevant changes before committing by doing `git add -p` instead of adding all modifications.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 28, 2020 at 9:17 PM Nathan Ridge via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.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">nridge marked an inline comment as done.<br>
nridge added inline comments.<br>
<br>
<br>
================<br>
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:708-710<br>
+    return std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName,<br>
+                    M1.Message) <<br>
+           std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);<br>
----------------<br>
nridge wrote:<br>
> sammccall wrote:<br>
> > nridge wrote:<br>
> > > njames93 wrote:<br>
> > > > This looks like a clang-format artifact, there are several other below. Could these be removed from this patch<br>
> > > If you insist, I can move them to a separate patch. I don't want to leave it unmodified because the change will come back every time someone touches the file.<br>
> > I don't personally care about this too much, but the changes are somewhat distracting in review, blame etc.<br>
> > <br>
> > The policy we've mostly followed is to format changed lines only (git clang-format, turn format-on-save off) and leave misformatted code alone until it's next touched.<br>
> > <br>
> > (Not sure if LLVM offers any guidance either way, but that's what Google does internally and IME it's been great)<br>
> The issue I have with that is that turning format-on-save off means you inevitably end up doing a lot of manual formatting as you write the code. With format-on-save, you can just write the tokens for a statement not caring about the formatting, do a save, and have the statement be formatted before you start writing the next one.<br>
I guess what we really want is "format on save for modified lines only". I found a [VSCode extension](<a href="https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.format-modified" rel="noreferrer" target="_blank" class="cremed">https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.format-modified</a>) which does that, I'll give that a try.<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D75286/new/" rel="noreferrer" target="_blank" class="cremed">https://reviews.llvm.org/D75286/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D75286" rel="noreferrer" target="_blank" class="cremed">https://reviews.llvm.org/D75286</a><br>
<br>
<br>
<br>
</blockquote></div></div>