[PATCH] D144037: [clang-tidy] allow tests to use -config-file instead of -config

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 13:47:53 PST 2023


ClockMan added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/check_clang_tidy.py:111
     if not any(
-        [arg.startswith('-config=') for arg in self.clang_tidy_extra_args]):
+        [arg.startswith('-config=') or arg.startswith('-config-file=') for arg in self.clang_tidy_extra_args]):
       self.clang_tidy_extra_args.append('-config={}')
----------------
clang-tidy works with -config and with --config.
But in documentation there is --config.

This python script should be updated to accept both single and double dash arguments for config.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp:1
-// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
 
----------------
maybe double -- for config-file ?

  --config-file=<string>         -
                                   Specify the path of .clang-tidy or custom config file:
                                    e.g. --config-file=/some/path/myTidyConfigFile
                                   This option internally works exactly the same way as
                                    --config option after reading specified config file.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144037/new/

https://reviews.llvm.org/D144037



More information about the cfe-commits mailing list