[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)
Chris Apple via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 16 16:42:54 PST 2023
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/75721
>From 433f4ac919a6967c278e56a19b5824e474ebd907 Mon Sep 17 00:00:00 2001
From: Chris Apple <14171107+cjappl at users.noreply.github.com>
Date: Sat, 16 Dec 2023 15:53:56 -0800
Subject: [PATCH 1/2] Add ability to pass in a clang-tidy config file to
clang-tidy-diff
---
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
index 8817e2914f6e25..fdaf1a4330e060 100755
--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
@@ -223,6 +223,12 @@ def main():
default=[],
help="Load the specified plugin in clang-tidy.",
)
+ parser.add_argument(
+ "-config",
+ dest="config",
+ default=None,
+ help="Specifies a clang-tidy config file"
+ )
clang_tidy_args = []
argv = sys.argv[1:]
@@ -309,6 +315,8 @@ def main():
# Form the common args list.
common_clang_tidy_args = []
+ if args.config is not None:
+ common_clang_tidy_args.append("--config-file=" + args.config)
if args.fix:
common_clang_tidy_args.append("-fix")
if args.checks != "":
>From ff3e289814d8af2c3c8eea12e3ee3c48959aa79a Mon Sep 17 00:00:00 2001
From: Chris Apple <14171107+cjappl at users.noreply.github.com>
Date: Sat, 16 Dec 2023 16:42:28 -0800
Subject: [PATCH 2/2] Fix style
---
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
index fdaf1a4330e060..e20b7a2cda2dde 100755
--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
@@ -227,7 +227,7 @@ def main():
"-config",
dest="config",
default=None,
- help="Specifies a clang-tidy config file"
+ help="Specifies a clang-tidy config file",
)
clang_tidy_args = []
More information about the cfe-commits
mailing list