================
@@ -289,8 +291,71 @@ 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 create_comment_text(
+        self, linter_output: str, files_to_lint: Sequence[str], args: LintArgs
+    ) -> str:
+        comment = super().create_comment_text(linter_output, files_to_lint, 
args)
+        if "D001" in linter_output or "Line too long" in linter_output:
+            parts = comment.rsplit("</details>", 1)
+            if len(parts) == 2:
+                return (
+                    parts[0]
+                    + "\nNote: documentation lines should be no more than 79 
characters wide.\n</details>"
----------------
zeyi2 wrote:

doc8's documentation says: `- lines should not be longer than 79 characters - 
D001`

should we set it to 80 by config?

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