spadarian / docblock-python

Atom plugin to insert documentation blocks for python functions
GNU General Public License v2.0
22 stars 9 forks source link

Wrong indentation of sphinx style :return: and :raises: #36

Closed oliver-joos closed 4 years ago

oliver-joos commented 5 years ago

docblock-python is really helpful, many thanks to spadarian!

I have a problem with indentation: if I choose style "sphinx" (and all checkboxes enabled) the lines with :return: are not indented at all, and :raises: are always indented 4 spaces, even if the doc comment starts more indented. The rest of the lines are ok.

Example: docblock-bug_sphinx-indent.txt

I tried to fix it by editing lib/templates.js, but did not succeed yet. Am I doing something wrong? Or is it a bug?

I use atom 1.40.1 and docblock 0.15.0.

spadarian commented 4 years ago

Thanks and sorry for the late reply.

Let me know if that fixed the problem.

oliver-joos commented 4 years ago

Great! Thank you! I confirm that style "sphinx" now works as expected in 0.15.1

Oh, I just found a case where indentation still gets wrong: If I disable "Show types" then :return: is always indented 0 spaces. (No problem for me because I work with "Show types" enabled)