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

changeset 8205
4a0f1f896341
parent 8198
1c765dc90c21
child 8207
d359172d11be
equal deleted inserted replaced
8204:fd477cded1c1 8205:4a0f1f896341
861 861
862 functionName = context.source()[0].lstrip().split()[1].split("(")[0] 862 functionName = context.source()[0].lstrip().split()[1].split("(")[0]
863 summary, lineNumber = self.__getSummaryLine(docstringContext) 863 summary, lineNumber = self.__getSummaryLine(docstringContext)
864 if ( 864 if (
865 functionName + "(" in summary.replace(" ", "") and 865 functionName + "(" in summary.replace(" ", "") and
866 not functionName + "()" in summary.replace(" ", "") 866 functionName + "()" not in summary.replace(" ", "")
867 ): 867 ):
868 # report only, if it is not an abbreviated form (i.e. function() ) 868 # report only, if it is not an abbreviated form (i.e. function() )
869 self.__error(docstringContext.start() + lineNumber, 0, "D133") 869 self.__error(docstringContext.start() + lineNumber, 0, "D133")
870 870
871 def __checkReturnType(self, docstringContext, context): 871 def __checkReturnType(self, docstringContext, context):
1032 summaryLines.pop(-1) 1032 summaryLines.pop(-1)
1033 summary = " ".join([s.strip() for s in summaryLines if s]) 1033 summary = " ".join([s.strip() for s in summaryLines if s])
1034 if ( 1034 if (
1035 summary and 1035 summary and
1036 not summary.endswith(".") and 1036 not summary.endswith(".") and
1037 not summary.split(None, 1)[0].lower() == "constructor" 1037 summary.split(None, 1)[0].lower() != "constructor"
1038 ): 1038 ):
1039 self.__error( 1039 self.__error(
1040 docstringContext.start() + lineNumber + 1040 docstringContext.start() + lineNumber +
1041 len(summaryLines) - 1, 1041 len(summaryLines) - 1,
1042 0, "D231") 1042 0, "D231")

eric ide

mercurial