(self, padding: int, is_secret: bool = False)
return LINE_DISPLAY["patch"].format(
            format_text(pre_index, line_count_style),
            format_text(post_index, line_count_style),
        )
Return the formatted line count.
Return the formatted line count.
Return the formatted line count .
def build_line_count(self, padding: int, is_secret: bool = False) -> str:
        """Return the formatted line count."""
        line_count_style = (
            STYLE["line_count_secret"] if is_secret else STYLE["line_count"]
        )
        if self.category is not None and not isinstance(self.category, LineCategory):
            raise TypeError("line category invalid")

        # File
        if self.category == LineCategory.data:
            return LINE_DISPLAY["file"].format(
                format_text(
                    format_line_count(self.pre_index, padding), line_count_style
                )
            )

        # Patch
        pre_index = format_line_count(self.pre_index, padding)
        post_index = format_line_count(self.post_index, padding)

        if self.category == LineCategory.addition:
            pre_index = " " * padding

        elif self.category == LineCategory.deletion:
            post_index = " " * padding

        return LINE_DISPLAY["patch"].format(
            format_text(pre_index, line_count_style),
            format_text(post_index, line_count_style),
        )
def build_line_count ( self , padding : int , is_secret : bool = False ) -> str : line_count_style = ( STYLE [ "line_count_secret" ] if is_secret else STYLE [ "line_count" ] ) if self . category is not None and not isinstance ( self . category , LineCategory ) : raise TypeError ( "line category invalid" ) # File if self . category == LineCategory . data : return LINE_DISPLAY [ "file" ] . format ( format_text ( format_line_count ( self . pre_index , padding ) , line_count_style ) ) # Patch pre_index = format_line_count ( self . pre_index , padding ) post_index = format_line_count ( self . post_index , padding ) if self . category == LineCategory . addition : pre_index = " " * padding elif self . category == LineCategory . deletion : post_index = " " * padding return LINE_DISPLAY [ "patch" ] . format ( format_text ( pre_index , line_count_style ) , format_text ( post_index , line_count_style ) , )