Skip to content

attempts to preserve substring indentation - #52

Closed
ntjess wants to merge 1 commit into
rr-:mainfrom
ntjess:preserve-indent
Closed

ntjess wants to merge 1 commit into
rr-:mainfrom
ntjess:preserve-indent

Conversation

@ntjess

@ntjess ntjess commented Aug 2, 2021

Copy link
Copy Markdown

The tests pass, but I have no idea if I did it the right way. Hoping this is easy enough for someone more experienced to pick up.

@rr- rr- left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create separate tests for strip_initial_whitespace function. Also I don't quite understand its purpose, which tests will help with.

CI is failing on style checks. https://github.com/rr-/docstring_parser/#contributing

@rr-

rr- commented Aug 3, 2021 •

Copy link
Copy Markdown
Owner

Also in Google style if we have:

    """Arguments:
        argument: long description,
            long description 2
    """

I'd expect long description 2 to be indented with 4 spaces (relative to the outer scope that is the argument), and currently it's still indented with 8 (that is relative to the global scope of Arguments:).

@rr-

rr- commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thanks for this, and sorry it waited so long. Main now keeps sub-indentation in descriptions in every style: continuation lines lose only the indent they share, so nested lines like the ConfigParser values in #51 keep their relative indent. The ReST and Google fixes landed in #137, and Numpydoc already behaved this way. It's the default rather than an option. I'm closing this one and #51 with it. Thanks for raising it and for having a go at the fix.

@rr- rr- closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optionally preserve sub-indentation while parsing?

2 participants