if I select a piece of code, f.e. some_method and run Cody Command: Document Code I get this:
def SomeClass(object):
"""Returns y multiplied by x plus 1.
Args:
x: The first number to multiply.
y: The second number to multiply.
Returns:
The product of y * (x + 1).
"""
def some_method(self, x, y):
return y * (x + 1)
the first thing to notice here is that alignment is broken between the second line of the docstring and the method definition.
the second thing to notice - if the alignment were right, this still does not comply with PEP 257 which stands for:
def method_name(params):
"""Method description.
Extended description and details.
"""
# method body
Expected behavior
def SomeClass(object):
def some_method(self, x, y):
"""Returns y multiplied by x plus 1.
Args:
x: The first number to multiply.
y: The second number to multiply.
Returns:
The product of y * (x + 1).
"""
return y * (x + 1)
This issue is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.
Version
v1.6.0
Describe the bug
When I ask Cody to generate a docstring for my python code it generates a good text but puts it on wrong spot with wrong alignment.
For example:
if I select a piece of code, f.e.
some_method
and runCody Command: Document Code
I get this:the first thing to notice here is that alignment is broken between the second line of the docstring and the method definition.
the second thing to notice - if the alignment were right, this still does not comply with
PEP 257
which stands for:Expected behavior
Additional context
No response