970 if len(docstrings) <= 3: |
970 if len(docstrings) <= 3: |
971 # correct/invalid one-liner |
971 # correct/invalid one-liner |
972 return |
972 return |
973 |
973 |
974 summary, lineNumber = self.__getSummaryLine(docstringContext) |
974 summary, lineNumber = self.__getSummaryLine(docstringContext) |
975 if len(docstrings) > 2: |
975 if ( |
976 if docstrings[lineNumber + 1].strip(): |
976 len(docstrings) > 2 and |
977 self.__error(docstringContext.start() + lineNumber, 0, "D144") |
977 docstrings[lineNumber + 1].strip() |
|
978 ): |
|
979 self.__error(docstringContext.start() + lineNumber, 0, "D144") |
978 |
980 |
979 def __checkBlankAfterLastParagraph(self, docstringContext, context): |
981 def __checkBlankAfterLastParagraph(self, docstringContext, context): |
980 """ |
982 """ |
981 Private method to check, that the last paragraph of docstrings is |
983 Private method to check, that the last paragraph of docstrings is |
982 followed by a blank line. |
984 followed by a blank line. |
1283 if len(docstrings) <= 3: |
1285 if len(docstrings) <= 3: |
1284 # correct/invalid one-liner |
1286 # correct/invalid one-liner |
1285 return |
1287 return |
1286 |
1288 |
1287 summaryLines, lineNumber = self.__getSummaryLines(docstringContext) |
1289 summaryLines, lineNumber = self.__getSummaryLines(docstringContext) |
1288 if len(docstrings) - 2 > lineNumber + len(summaryLines) - 1: |
1290 if ( |
1289 if docstrings[lineNumber + len(summaryLines)].strip(): |
1291 len(docstrings) - 2 > lineNumber + len(summaryLines) - 1 and |
1290 self.__error(docstringContext.start() + lineNumber, 0, "D246") |
1292 docstrings[lineNumber + len(summaryLines)].strip() |
|
1293 ): |
|
1294 self.__error(docstringContext.start() + lineNumber, 0, "D246") |
1291 |
1295 |
1292 def __checkEricNoBlankBeforeAndAfterClassOrFunction( |
1296 def __checkEricNoBlankBeforeAndAfterClassOrFunction( |
1293 self, docstringContext, context): |
1297 self, docstringContext, context): |
1294 """ |
1298 """ |
1295 Private method to check, that class and function/method docstrings |
1299 Private method to check, that class and function/method docstrings |