315 ("D244", "D245"), |
315 ("D244", "D245"), |
316 ), |
316 ), |
317 (self.__checkEricException, ("D250", "D251", "D252", "D253")), |
317 (self.__checkEricException, ("D250", "D251", "D252", "D253")), |
318 (self.__checkEricDocumentationSequence, ("D270", "D271")), |
318 (self.__checkEricDocumentationSequence, ("D270", "D271")), |
319 (self.__checkEricDocumentationDeprecatedTags, ("D272",)), |
319 (self.__checkEricDocumentationDeprecatedTags, ("D272",)), |
320 (self.__checkEricDocumentationIndent, ("D273",)) |
320 (self.__checkEricDocumentationIndent, ("D273",)), |
321 ], |
321 ], |
322 "docstring": [ |
322 "docstring": [ |
323 (self.__checkTripleDoubleQuotes, ("D111",)), |
323 (self.__checkTripleDoubleQuotes, ("D111",)), |
324 (self.__checkBackslashes, ("D112",)), |
324 (self.__checkBackslashes, ("D112",)), |
325 (self.__checkIndent, ("D122",)), |
325 (self.__checkIndent, ("D122",)), |
1633 for lineno, line in enumerate(lines): |
1633 for lineno, line in enumerate(lines): |
1634 strippedLine = line.lstrip() |
1634 strippedLine = line.lstrip() |
1635 if strippedLine.startswith("@"): |
1635 if strippedLine.startswith("@"): |
1636 docToken = strippedLine.split(None, 1)[0] |
1636 docToken = strippedLine.split(None, 1)[0] |
1637 docTokens.append((docToken, lineno)) |
1637 docTokens.append((docToken, lineno)) |
1638 |
1638 |
1639 # check, that a type tag is not preceded by an empty line |
1639 # check, that a type tag is not preceded by an empty line |
1640 if ( |
1640 if ( |
1641 docToken in ("@type", "@rtype", "@ytype") |
1641 docToken in ("@type", "@rtype", "@ytype") |
1642 and lineno > 0 |
1642 and lineno > 0 |
1643 and lines[lineno - 1].strip() == "" |
1643 and lines[lineno - 1].strip() == "" |
1644 ): |
1644 ): |
1645 self.__error( |
1645 self.__error(docstringContext.start() + lineno, 0, "D271", docToken) |
1646 docstringContext.start() + lineno, 0, "D271", docToken |
|
1647 ) |
|
1648 |
1646 |
1649 # check the correct sequence of @param/@return/@yield and their accompanying |
1647 # check the correct sequence of @param/@return/@yield and their accompanying |
1650 # type tag |
1648 # type tag |
1651 for index in range(len(docTokens)): |
1649 for index in range(len(docTokens)): |
1652 docToken, lineno = docTokens[index] |
1650 docToken, lineno = docTokens[index] |