================
@@ -289,8 +291,56 @@ def _clean_clang_tidy_output(self, output: str) -> str:
         return ""
 
 
+class Doc8LintHelper(LintHelper):
+    name: Final = "doc8"
+    friendly_name: Final = "RST documentation linter"
 
-ALL_LINTERS = (ClangTidyLintHelper(),)
+    def instructions(self, files_to_lint: Iterable[str], args: LintArgs) -> 
str:
+        return f"doc8 -q {' '.join(files_to_lint)}"
+
+    def filter_changed_files(self, changed_files: Iterable[str]) -> 
Sequence[str]:
+        return list(filter(self._should_lint_file, changed_files))
+
+    def _should_lint_file(self, filepath: str) -> bool:
+        return (
+            os.path.splitext(filepath)[1] == ".rst"
+            and filepath.startswith("clang-tools-extra/docs/clang-tidy/")
+            and os.path.exists(filepath)
+        )
+
+    def run_linter_tool(self, files_to_lint: Iterable[str], args: LintArgs) -> 
str:
----------------
zeyi2 wrote:

I think there was some discussion in this RFC: 
https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style/68257

https://github.com/llvm/llvm-project/pull/172123
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to