eric7/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py

branch
eric7
changeset 9182
bc72e2fc0d8e
parent 9179
9ae7ca51e347
diff -r 809709f6f1d5 -r bc72e2fc0d8e eric7/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py
--- a/eric7/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py	Sun Jun 26 19:02:37 2022 +0200
+++ b/eric7/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py	Mon Jun 27 13:26:01 2022 +0200
@@ -211,7 +211,7 @@
                     (self.__checkBlankAfterLastParagraph, ("D145",)),
                 ],
             }
-        elif self.__docType == "eric":
+        elif self.__docType in ("eric", "eric_black"):
             checkersWithCodes = {
                 "moduleDocstring": [
                     (self.__checkModulesDocstrings, ("D101", "D201")),
@@ -1335,12 +1335,21 @@
         if isClassContext:
             if not contextLines[start - 1].strip():
                 self.__error(docstringContext.start(), 0, "D242")
-            if not contextLines[end + 1].strip():
+            if not contextLines[end + 1].strip() and self.__docType == "eric":
                 self.__error(docstringContext.end(), 0, "D243")
+            elif contextLines[end + 1].strip() and self.__docType == "eric_black":
+                self.__error(docstringContext.end(), 0, "D143")
         else:
             if not contextLines[start - 1].strip():
                 self.__error(docstringContext.start(), 0, "D244")
             if not contextLines[end + 1].strip():
+                if (
+                    self.__docType == "eric_black" and
+                    len(contextLines) > end + 2 and
+                    contextLines[end + 2].strip().startswith("def ")
+                ):
+                    return
+                
                 self.__error(docstringContext.end(), 0, "D245")
     
     def __checkEricNBlankAfterLastParagraph(self, docstringContext, context):

eric ide

mercurial