[PATCH] D126134: [clang-tidy] Improve add_new_check.py to recognize more checks

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 21 16:38:22 PDT 2022


LegalizeAdulthood created this revision.
LegalizeAdulthood added reviewers: aaron.ballman, njames93, alexfh.
LegalizeAdulthood added a project: clang-tools-extra.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a project: All.
LegalizeAdulthood requested review of this revision.

When looking for whether or not a check provides fixits, the script
examines the implementation of the check.  Some checks are not
implemented in source files that correspond one-to-one with the check
name, e.g. cert-dcl21-cpp.  So if we can't find the check implementation
directly from the check name, open up the corresponding module file and
look for the class name that is registered with the check.  Then consult
the file corresponding to the class name.

Some checks are derived from a base class that implements fixits.  So if
we can't find fixits in the implementation file for a check, scrape out
the name of it's base class.  If it's not ClangTidyCheck, then consult
the base class implementation to look for fixit support.

Fixes #55630


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126134

Files:
  clang-tools-extra/clang-tidy/add_new_check.py
  clang-tools-extra/docs/clang-tidy/checks/list.rst

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126134.431185.patch
Type: text/x-patch
Size: 8514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220521/6bf556ca/attachment-0001.bin>


More information about the cfe-commits mailing list