--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py Thu Jun 25 19:09:55 2020 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py Sat Jun 27 12:08:12 2020 +0200 @@ -12,15 +12,10 @@ # pep257.py (version 0.2.4). # -try: - # Python 2 - from StringIO import StringIO # __IGNORE_EXCEPTION__ -except ImportError: - # Python 3 - from io import StringIO # __IGNORE_WARNING__ import tokenize import ast import sys +from io import StringIO try: ast.AsyncFunctionDef # __IGNORE_EXCEPTION__ @@ -128,7 +123,7 @@ """ Codes = [ "D101", "D102", "D103", "D104", "D105", - "D111", "D112", "D113", + "D111", "D112", "D121", "D122", "D130", "D131", "D132", "D133", "D134", "D141", "D142", "D143", "D144", "D145", @@ -209,7 +204,6 @@ "docstring": [ (self.__checkTripleDoubleQuotes, ("D111",)), (self.__checkBackslashes, ("D112",)), - (self.__checkUnicode, ("D113",)), (self.__checkOneLiner, ("D121",)), (self.__checkIndent, ("D122",)), (self.__checkSummary, ("D130",)), @@ -249,7 +243,6 @@ "docstring": [ (self.__checkTripleDoubleQuotes, ("D111",)), (self.__checkBackslashes, ("D112",)), - (self.__checkUnicode, ("D113",)), (self.__checkIndent, ("D122",)), (self.__checkSummary, ("D130",)), (self.__checkEricEndsWithPeriod, ("D231",)), @@ -778,24 +771,6 @@ if "\\" in docstring and not docstring.startswith('r"""'): self.__error(docstringContext.start(), 0, "D112") - def __checkUnicode(self, docstringContext, context): - """ - Private method to check, that all docstrings containing unicode - characters are surrounded by unicode triple double quotes. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstring = docstringContext.ssource().strip() - if ( - not docstring.startswith('u"""') and - any(ord(char) > 127 for char in docstring) - ): - self.__error(docstringContext.start(), 0, "D113") - def __checkOneLiner(self, docstringContext, context): """ Private method to check, that one-liner docstrings fit on @@ -1467,6 +1442,3 @@ if firstWord != 'public': self.__error(docstringContext.start() + lineNumber, 0, "D232", 'public') - -# -# eflag: noqa = M702