Closed JohannesBuchner closed 1 year ago
I was able to solve this with the indentation attribute like this:
barfunc.value.insert(0, textwrap.indent('''"""%s function.
Does beautiful things.
"""''' % barfunc.name, barfunc.value[0].indentation).lstrip())
The gendocstr.py tool is available here as part of pystrict3 if you are interested: https://github.com/JohannesBuchner/pystrict3#gendocstrpy-tool
Thank you for creating redbaron. I am writing a tool to pre-generate numpy-style parameter documentation.
Attaching a docstring to a function gives a somewhat arbitrary indent:
Actual result:
Expected result:
The behaviour also occurs in nested functions:
The current behaviour of redbaron seems to assume:
Please let me know if this is the intended behaviour or whether you consider this a bug.
If the user of redbaron is supposed to work around this somehow, please let me know how, because it seems quite difficult to guess and fix the indent.