[clang-tools-extra] [clang-tidy] Header check support for check_clang_tidy.py (PR #175735)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 13 07:54:45 PST 2026
================
@@ -299,19 +367,73 @@ def check_notes(self, clang_tidy_output: str) -> None:
]
)
+ def check_header_messages(self, clang_tidy_output: str) -> str:
+ """
+ Filters and verifies clang-tidy diagnostics for headers.
+
+ - Input: The raw diagnostic output from clang-tidy.
+ - Output: The diagnostic output intended for the main file
+ verification.
+
+ This function separates messages belonging to headers specified by
+ `-check-header', verifies them using FileCheck against the header's
+ own rules, and returns the rest for further processing.
+ """
+ if not self.check_headers:
+ return clang_tidy_output
+
+ header_messages: Dict[str, List[str]] = {
----------------
EugeneZelenko wrote:
`defaultdict` should be used instead.
https://github.com/llvm/llvm-project/pull/175735
More information about the cfe-commits
mailing list