Don't append --checks=* when the --config or --config-file flags are set (#4210)

Appending --checks=* causes clang-tidy to ignore the flags --config
and --config-file, which breaks the ability to use a clang-tidy file
This commit is contained in:
Zach Zodkoy
2022-03-30 04:47:14 -04:00
committed by GitHub
parent 6c8173d1aa
commit 6123d6f9bf

View File

@ -60,7 +60,9 @@ class ClangtidyCheckTool(CheckToolBase):
cmd = [tool_path, "--quiet"]
flags = self.get_flags("clangtidy")
if not self.is_flag_set("--checks", flags):
if not (
self.is_flag_set("--checks", flags) or self.is_flag_set("--config", flags)
):
cmd.append("--checks=*")
project_files = self.get_project_target_files(self.options["patterns"])