-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to pass in a clang-tidy config file to clang-tidy-diff #75721
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang-tidy Author: Chris Apple (cjappl) ChangesI found this handy for situations where you want to pass in a config file and not rely on a default The new option is Full diff: https://github.com/llvm/llvm-project/pull/75721.diff 1 Files Affected:
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 != "":
|
@njames93 friendly ping for a review on this PR. Thank you in advance! |
|
This is almost exactly the same as #75457 , just with the release notes. I'm going to close this for now and re-open it if that one gets stale. |
I found this handy for situations where you want to pass in a config file and not rely on a default
.clang-tidy
file.The new option is
-config
and will expect something that can be passed into the--config-file=
parameter ofclang-tidy