[PATCH] D146875: [clang-tidy] Fix example provided by add_new_check.py
Carlos Galvez via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 28 12:46:26 PDT 2023
carlosgalvezp added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/add_new_check.py:278
with io.open(filename, 'w', encoding='utf8', newline='\n') as f:
- f.write("""// RUN: %%check_clang_tidy %%s %(check_name_dashes)s %%t
+ f.write("""// RUN: %%check_clang_tidy %%s %(check_name_dashes)s %%t -- --fix-notes
----------------
There is only 6 check tests in the clang-tidy folder that use `--fix-notes`, so I believe this is not quite standard. Thus I'm not convinced this should be part of the example test, which is supposed to be fairly basic. Would it be better to change the example check instead, so that the fix is not attached to the note? Example:
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome, prepend it with 'awesome_'")
<< MatchedDecl
<< FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146875/new/
https://reviews.llvm.org/D146875
More information about the cfe-commits
mailing list