<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 13, 2015 at 6:43 PM, Andrew C. Morrow <span dir="ltr"><<a href="mailto:andrew.c.morrow@gmail.com" target="_blank">andrew.c.morrow@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 12, 2015 at 7:01 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Andrew, Richard,</div><span><div class="gmail_quote"><br></div><div class="gmail_quote">> <span style="font-size:12.8000001907349px">I asked this over on cfe-user last week, but got no response there:</span></div></span><div><span style="font-size:12.8000001907349px"><br>Sorry, I wasn't even aware of this list before I saw your e-mail. Currently cfe-dev is a better place for clang-tidy questions.</span></div></div></div></blockquote><div><br></div><div>It looks like cfe-user is not widely used. That is maybe unfortunate, in my opinion there should be a place to ask user-ish questions without cluttering the dev list.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">Re: your main question. While in general YAML/JSON/... would be a better format to output clang-tidy results for other tools, I see that there are valid use cases for parsing text diagnostic output, as there are many tools doing this with compiler diagnostics. And we certainly need to allow configuration of the diagnostic output. However --extra-arg is just not the right mechanism for this, as it just modifies compilation arguments clang-tidy gets from a compilation database. We can't configure output of clang-tidy using these arguments, as they can be arbitrary and even different for each processed file.</div></div></div></blockquote><div><br></div><div>That makes sense, thanks for clarifying. Perhaps the help text for -extra-arg could be amended to give some indication of which sort of flags are honored, and which are not? It really did look like exactly what I wanted.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">A better way to make diagnostic output configurable is to add top-level clang-tidy flags. Is it the only flag you need or would some other similar flags be useful as well?</div></div></div></blockquote><div><br></div><div>Ideally I think the whole set of diagnostics switches described here:<br></div><div><br></div><div><a href="http://clang.llvm.org/docs/UsersManual.html#controlling-how-clang-displays-diagnostics" target="_blank">http://clang.llvm.org/docs/UsersManual.html#controlling-how-clang-displays-diagnostics</a><br></div><div><br></div><div>My reasoning is that if you have an existing tool parsing clang diagnostics output it may already be using any of these flags to customize, and if the goal is to make clang-tidy useable as a drop in replacement for 'clang -fsyntax-only' or similar it would need to support the same options with the same effects on diagnostic presentation.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">I can't promise that I can add the support for these quickly, but it definitely seems like a useful thing to have.</div></div></div></blockquote><div><br></div><div>Great. I've not looked into the clang-tidy code but if you think this would be reasonably straightforward I might just try to implement it.</div></div></div></div></blockquote><div><br></div><div>It shouldn't be difficult to implement. Though it may require some non-zero effort to comply with the project's coding style. If you want to give it a shot, I'll be happy to review the patch (the preferred way is to send it to me, CC: cfe-commits@ via <a href="http://reviews.llvm.org">Phabricator</a>, as described <a href="http://llvm.org/docs/Phabricator.html">here</a>).</div><div> </div><div><br></div><div>-- Alex</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Thanks,</div><div>Andrew</div><div><br></div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br>
</div></div>