--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitDiffParser.py Fri Dec 22 19:45:17 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitDiffParser.py Sat Dec 23 15:40:23 2023 +0100 @@ -22,7 +22,8 @@ """ Constructor - @param diff output of the diff command (list of string) + @param diff output of the diff command + @type list of str """ self.__diff = diff[:] @@ -35,7 +36,8 @@ """ Private method to initialize a hunk data structure. - @return hunk data structure (dictionary) + @return hunk data structure + @rtype dict """ hunk = { "start": -1, @@ -53,8 +55,10 @@ """ Private method to parse the hunk header range part. - @param headerRange hunk header range (string) - @return tuple of hunk start and hunk length (integer, integer) + @param headerRange hunk header range + @type str + @return tuple of hunk start and hunk length + @rtype tuple of (int, int) """ if "," in headerRange: begin, end = headerRange.split(",", 1) @@ -104,9 +108,12 @@ """ Private method to generate a hunk header range. - @param start start line (integer) - @param count line count (integer) - @return hunk header range (string) + @param start start line + @type int + @param count line count + @type int + @return hunk header range + @rtype str """ if count == 1: return "{0}".format(start) @@ -119,12 +126,18 @@ """ Private method to generate a hunk header line. - @param oldStart start line of the old part (integer) - @param oldCount line count of the old part (integer) - @param newStart start line of the new part (integer) - @param newCount line count of the new part (integer) - @param heading hunk heading (string) - @return hunk header (string) + @param oldStart start line of the old part + @type int + @param oldCount line count of the old part + @type int + @param newStart start line of the new part + @type int + @param newCount line count of the new part + @type int + @param heading hunk heading + @type str + @return hunk header + @rtype str """ return "@@ -{0} +{1} @@{2}".format( self.__generateRange(oldStart, oldCount), @@ -136,7 +149,8 @@ """ Public method to get the header length. - @return length of the header (integer) + @return length of the header + @rtype int """ self.__parseDiff() return len(self.__headerLines) @@ -145,8 +159,10 @@ """ Public method to create a hunk based patch. - @param lineIndex line number of the hunk (integer) - @return diff lines of the patch (string) + @param lineIndex line number of the hunk + @type int + @return diff lines of the patch + @rtype str """ self.__parseDiff() @@ -162,10 +178,14 @@ """ Public method to create a selected lines based patch. - @param startIndex start line number (integer) - @param endIndex end line number (integer) - @param reverse flag indicating a reverse patch (boolean) - @return diff lines of the patch (string) + @param startIndex start line number + @type int + @param endIndex end line number + @type int + @param reverse flag indicating a reverse patch + @type bool + @return diff lines of the patch + @rtype str """ self.__parseDiff()