================
@@ -292,26 +355,78 @@ def check_notes(self, clang_tidy_output: str) -> None:
try_run(
[
"FileCheck",
- "-input-file=" + notes_file,
+ f"-input-file={notes_file}",
self.input_file_name,
- "-check-prefixes=" + ",".join(self.notes.prefixes),
+ f"-check-prefixes={','.join(self.notes.prefixes)}",
"-implicit-check-not={{note|warning|error}}:",
]
)
+ 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 = defaultdict(list)
+ remaining_lines: List[str] = []
+ current_file: str = ""
----------------
EugeneZelenko wrote:
```suggestion
current_file = ""
```
Type is inferred from literal.
https://github.com/llvm/llvm-project/pull/175735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits