[llvm] [Github][CI] Add `doc8` for clang-tidy documentation formatting (PR #168827)

Baranov Victor via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 04:24:08 PST 2025


================
@@ -215,7 +235,125 @@ def run_clang_tidy(changed_files: List[str], args: LintArgs) -> Optional[str]:
     return clean_clang_tidy_output(proc.stdout.strip())
 
 
-def run_linter(changed_files: List[str], args: LintArgs) -> tuple[bool, Optional[dict]]:
+def clean_doc8_output(output: str) -> Optional[str]:
+    if not output:
+        return None
+
+    lines = output.split("\n")
+    cleaned_lines = []
+    in_summary = False
+
+    for line in lines:
+        if line.startswith("Scanning...") or line.startswith("Validating..."):
+            continue
+        if line.startswith("========"):
+            in_summary = True
+            continue
+        if in_summary:
+            continue
+        if line.strip():
+            cleaned_lines.append(line)
----------------
vbvictor wrote:

Can we use `-q, --quiet           only print violations` flag of doc8?

https://github.com/llvm/llvm-project/pull/168827


More information about the llvm-commits mailing list