Adding the check id sounds like a useful feature.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 21, 2015, 1:44 PM Ilia Gromov 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
clang-tidy saves a YAML report when the option '-export-fixes=...> is used.<br>
<br>
---<br>
MainSourceFile:  ''<br>
Replacements:<br>
   - FilePath:        /home/ilia/clang/sandbox/main.cpp<br>
     Offset:          388<br>
     Length:          8<br>
     ReplacementText: '// TODO(ilia): '<br>
...<br>
<br>
This information is sufficient to apply generated replacements later.<br>
However, there is no information about a check which had found this warning.<br>
<br>
Is there a way to know check ID for this replacement?<br>
<br>
<br>
PS:<br>
In clang-modernize this problem was solved with a workaround:<br>
When in "serialize-replacements" mode, clang-modernize can't inspect<br>
sources more than for 1 check ID.<br>
So, when I run<br>
<br>
     ./clang-modernize -serialize-replacements<br>
-serialize-dir=/tmp/modernize/add-override112233 /tmp/source.cpp<br>
<br>
I'm sure that a YAML file in /tmp/modernize/add-override112233 is for<br>
"add-override" check.Repeat this for all 6 checks and, as a result, you<br>
can group replacements by check ID.<br>
clang-tidy allows to specify any number of check IDs when saving to<br>
YAML. And it has way more checks than 6. So, this workaround won't work<br>
well in case of clang-tidy<br>
<br>
--<br>
<br>
Thanks,<br>
Ilia Gromov<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>