776 cti = 0 |
776 cti = 0 |
777 while cti < len(contextLines) and \ |
777 while cti < len(contextLines) and \ |
778 not contextLines[cti].strip().startswith( |
778 not contextLines[cti].strip().startswith( |
779 ('"""', 'r"""', 'u"""', "'''", "r'''", "u'''")): |
779 ('"""', 'r"""', 'u"""', "'''", "r'''", "u'''")): |
780 cti += 1 |
780 cti += 1 |
781 |
|
782 if cti == len(contextLines): |
781 if cti == len(contextLines): |
783 return |
782 return |
784 |
783 |
785 if not contextLines[cti - 1].strip(): |
784 if not contextLines[cti - 1].strip(): |
786 self.__error(docstringContext.start(), 0, "D141") |
785 self.__error(docstringContext.start(), 0, "D141") |
833 """ |
832 """ |
834 if docstringContext is None: |
833 if docstringContext is None: |
835 return |
834 return |
836 |
835 |
837 docstrings = docstringContext.source() |
836 docstrings = docstringContext.source() |
838 if len(docstrings) in [1, 3]: |
837 if len(docstrings) <= 3: |
839 # correct/invalid one-liner |
838 # correct/invalid one-liner |
840 return |
839 return |
841 |
840 |
842 summary, lineNumber = self.__getSummaryLine(docstringContext) |
841 summary, lineNumber = self.__getSummaryLine(docstringContext) |
843 if len(docstrings) > 2: |
842 if len(docstrings) > 2: |