[clang-tidy] Add --exclude-grep to skip files by content (#16813)

This commit is contained in:
Jonathan Swoboda
2026-06-04 17:58:22 -04:00
committed by GitHub
parent e2459a3923
commit 5288767abf

View File

@@ -247,6 +247,12 @@ def main():
action="append",
help="only run on files containing value",
)
parser.add_argument(
"-x",
"--exclude-grep",
action="append",
help="skip files containing value",
)
parser.add_argument(
"--split-num", type=int, help="split the files into X jobs.", default=None
)
@@ -281,6 +287,10 @@ def main():
if args.grep:
files = filter_grep(files, args.grep)
if args.exclude_grep:
excluded = set(filter_grep(files, args.exclude_grep))
files = [f for f in files if f not in excluded]
files.sort()
if args.split_num: