[llvm] [Github][CI] Introduce `doc8` to `code-lint-helper.py` (PR #172123)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 20:34:11 PST 2025


================
@@ -289,8 +291,59 @@ def _clean_clang_tidy_output(self, output: str) -> str:
         return ""
 
 
+class Doc8LintHelper(LintHelper):
+    name: Final = "doc8"
+    friendly_name: Final = "documentation linter"
 
-ALL_LINTERS = (ClangTidyLintHelper(),)
+    def instructions(self, files_to_lint: Sequence[str], args: LintArgs) -> str:
+        files_str = " ".join(files_to_lint)
+        return f"doc8 -q {files_str}"
+
+    def filter_changed_files(self, changed_files: Sequence[str]) -> Sequence[str]:
+        filtered_files = []
+        for filepath in changed_files:
+            _, ext = os.path.splitext(filepath)
+            if ext != ".rst":
+                continue
+            if not filepath.startswith("clang-tools-extra/docs/clang-tidy/"):
+                continue
+            if os.path.exists(filepath):
+                filtered_files.append(filepath)
+        return filtered_files
+
+    def run_linter_tool(self, files_to_lint: Sequence[str], args: LintArgs) -> str:
----------------
EugeneZelenko wrote:

```suggestion
    def run_linter_tool(self, files_to_lint: Iterable[str], args: LintArgs) -> str:
```

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


More information about the llvm-commits mailing list