@@ -48,13 +48,13 @@ class StringFormatter(Formatter):
4848 """Base class for formatter that only modifies the string content."""
4949
5050 @abc .abstractmethod
51- def _treat_string (self , tokeninfo : tokenize .TokenInfo , indent_length : int ) -> str :
51+ def treat_string (self , tokeninfo : tokenize .TokenInfo , indent_length : int ) -> str :
5252 """Return a modified string."""
5353
5454 def treat_token (self , tokeninfo : tokenize .TokenInfo ) -> tokenize .TokenInfo :
5555 return tokenize .TokenInfo (
5656 tokeninfo .type ,
57- self ._treat_string (tokeninfo , tokeninfo .start [1 ]),
57+ self .treat_string (tokeninfo , tokeninfo .start [1 ]),
5858 tokeninfo .start ,
5959 tokeninfo .end ,
6060 tokeninfo .line ,
@@ -68,7 +68,7 @@ class StringAndQuotesFormatter(Formatter):
6868 """Pattern to match against opening quotes."""
6969
7070 @abc .abstractmethod
71- def _treat_string (
71+ def treat_string (
7272 self ,
7373 tokeninfo : tokenize .TokenInfo ,
7474 indent_length : int ,
@@ -88,7 +88,7 @@ def treat_token(self, tokeninfo: tokenize.TokenInfo) -> tokenize.TokenInfo:
8888
8989 return tokenize .TokenInfo (
9090 tokeninfo .type ,
91- self ._treat_string (
91+ self .treat_string (
9292 tokeninfo ,
9393 tokeninfo .start [1 ],
9494 quotes ,
@@ -104,7 +104,7 @@ class SummaryAndDescriptionFormatter(StringAndQuotesFormatter):
104104 """Base class for formatter that modifies the summary and description."""
105105
106106 @abc .abstractmethod
107- def _treat_summary (
107+ def treat_summary (
108108 self ,
109109 summary : str ,
110110 indent_length : int ,
@@ -114,12 +114,12 @@ def _treat_summary(
114114 """Return a modified summary."""
115115
116116 @abc .abstractmethod
117- def _treat_description (self , description : str , indent_length : int ) -> str :
117+ def treat_description (self , description : str , indent_length : int ) -> str :
118118 """Return a modified description."""
119119
120120 @staticmethod
121121 @functools .lru_cache (maxsize = None )
122- def _separate_summary_and_description (
122+ def separate_summary_and_description (
123123 docstring : str , indent_length : int , quotes_length : Literal [1 , 3 ]
124124 ) -> tuple [str , str , str | None ]:
125125 """Split the summary and description and handle quotes and indentation."""
@@ -153,26 +153,26 @@ def _separate_summary_and_description(
153153 summary = summary [1 + indent_length :]
154154 return prefix , summary , description
155155
156- def _treat_string (
156+ def treat_string (
157157 self ,
158158 tokeninfo : tokenize .TokenInfo ,
159159 indent_length : int ,
160160 quotes : str ,
161161 quotes_length : Literal [1 , 3 ],
162162 ) -> str :
163- prefix , summary , description = self ._separate_summary_and_description (
163+ prefix , summary , description = self .separate_summary_and_description (
164164 tokeninfo .string ,
165165 indent_length ,
166166 quotes_length ,
167167 )
168168
169- new_summary = self ._treat_summary (
169+ new_summary = self .treat_summary (
170170 summary , indent_length , quotes_length , bool (description )
171171 )
172172 docstring = f"{ quotes } { prefix } { new_summary } "
173173
174174 if description :
175- new_description = self ._treat_description (description , indent_length )
175+ new_description = self .treat_description (description , indent_length )
176176 docstring += f"\n \n { new_description } "
177177
178178 # Determine whether ending quotes were initially on same or new line
@@ -185,7 +185,7 @@ class SummaryFormatter(SummaryAndDescriptionFormatter):
185185 """Base class for formatter that only modifies the summary of a docstring."""
186186
187187 @abc .abstractmethod
188- def _treat_summary (
188+ def treat_summary (
189189 self ,
190190 summary : str ,
191191 indent_length : int ,
@@ -194,5 +194,5 @@ def _treat_summary(
194194 ) -> str :
195195 """Return a modified summary."""
196196
197- def _treat_description (self , description : str , indent_length : int ) -> str :
197+ def treat_description (self , description : str , indent_length : int ) -> str :
198198 return description
0 commit comments