@@ -5294,8 +5294,10 @@ def state_function_docstring(self, line):
5294
5294
new_docstring += line
5295
5295
self .function .docstring = new_docstring
5296
5296
5297
- def format_docstring (self ):
5297
+ def format_docstring (self ) -> str :
5298
5298
f = self .function
5299
+ assert f is not None
5300
+ assert f .full_name is not None
5299
5301
5300
5302
new_or_init = f .kind .new_or_init
5301
5303
if new_or_init and not f .docstring :
@@ -5338,7 +5340,7 @@ def format_docstring(self):
5338
5340
5339
5341
right_bracket_count = 0
5340
5342
5341
- def fix_right_bracket_count (desired ) :
5343
+ def fix_right_bracket_count (desired : int ) -> str :
5342
5344
nonlocal right_bracket_count
5343
5345
s = ''
5344
5346
while right_bracket_count < desired :
@@ -5372,7 +5374,7 @@ def fix_right_bracket_count(desired):
5372
5374
last_p = parameters [- 1 ]
5373
5375
line_length = len ('' .join (text ))
5374
5376
indent = " " * line_length
5375
- def add_parameter (text ) :
5377
+ def add_parameter (text : str ) -> None :
5376
5378
nonlocal line_length
5377
5379
nonlocal first_parameter
5378
5380
if first_parameter :
@@ -5488,9 +5490,9 @@ def add_parameter(text):
5488
5490
add (p .name )
5489
5491
add ('\n ' )
5490
5492
add (textwrap .indent (rstrip_lines (p .docstring .rstrip ()), " " ))
5491
- parameters = output ()
5492
- if parameters :
5493
- parameters += '\n '
5493
+ parameters_output = output ()
5494
+ if parameters_output :
5495
+ parameters_output += '\n '
5494
5496
5495
5497
##
5496
5498
## docstring body
@@ -5538,7 +5540,7 @@ def add_parameter(text):
5538
5540
add (docstring )
5539
5541
docstring = output ()
5540
5542
5541
- docstring = linear_format (docstring , parameters = parameters )
5543
+ docstring = linear_format (docstring , parameters = parameters_output )
5542
5544
docstring = docstring .rstrip ()
5543
5545
5544
5546
return docstring
0 commit comments