-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Adding a docstring adds indent, including on empty lines.
I am analysing and altering example.py:
def indicator(r, threshold=42):
if r > threshold:
return False
else:
return True
with the following code
import redbaron
rb = redbaron.RedBaron(open('gendocstr/example2.py').read())
docstring = """Hello world
how is it going?
"""
rb[0].value.insert(0, '"""%s"""' % docstring)
print(rb.dumps())
gives:
def indicator(r, threshold=42):
"""Hello world
how is it going?
"""
if r > threshold:
return False
else:
return True
The line in the middle is also indented.
This causes linters to complain about trailing newlines.
As far as I can see, there is no way to control the automatic indentation.
This is with redbaron 0.9.2
Metadata
Metadata
Assignees
Labels
No labels