[all-commits] [llvm/llvm-project] 89e663: [clang-tidy] Improve add_new_check.py to recognize...

Richard Thomson via All-commits all-commits at lists.llvm.org
Mon May 23 08:48:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89e663c4f83a6736fc74a01ec48cb4f01210f86f
      https://github.com/llvm/llvm-project/commit/89e663c4f83a6736fc74a01ec48cb4f01210f86f
  Author: Richard <legalize at xmission.com>
  Date:   2022-05-23 (Mon, 23 May 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/add_new_check.py
    M clang-tools-extra/docs/clang-tidy/checks/list.rst

  Log Message:
  -----------
  [clang-tidy] Improve add_new_check.py to recognize more checks

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.

Differential Revision: https://reviews.llvm.org/D126134

Fixes #55630




More information about the All-commits mailing list