[PATCH] D118104: Make run-clang-tidy.py print the configured checks correctly

Jesko Appelfeller via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 24 23:52:58 PST 2022


JesApp created this revision.
JesApp added a reviewer: alexfh.
JesApp added a project: clang-tools-extra.
Herald added a subscriber: carlosgalvezp.
JesApp requested review of this revision.
Herald added a subscriber: cfe-commits.

The test invocation at the start of run-clang-tidy.py (line 257) prints all enabled checks - meaning either the default set or anything configured via the -checks option. If any checks were (un-)configured via the -config option, these are not printed. This is confusing to the user, since the list of checks that are printed may be different from the list of checks that are used by the non-testing calls to clang-tidy, where the -config option is passed correctly.

This patch adds the -config option to the test invocation of clang-tidy at the start of the script. This means that checks (un-)configured via the -config option (rather than the -checks option) are applied correctly, when printing the list of enabled checks.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118104

Files:
  clang-tools-extra/clang-tidy/tool/run-clang-tidy.py


Index: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -260,6 +260,8 @@
     invocation.append('-p=' + build_path)
     if args.checks:
       invocation.append('-checks=' + args.checks)
+    if args.config:
+      invocation.append('-config=' + args.config)
     invocation.append('-')
     if args.quiet:
       # Even with -quiet we still want to check if we can call clang-tidy.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118104.402770.patch
Type: text/x-patch
Size: 570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220125/b1bbafe5/attachment-0001.bin>


More information about the cfe-commits mailing list