Skip to content

Avoid duplicate calls to autodoc-process-docstring - #4198

Merged
shimizukawa merged 3 commits into
sphinx-doc:masterfrom
jnothman:double-processed
Jan 8, 2018
Merged

shimizukawa merged 3 commits into
sphinx-doc:masterfrom
jnothman:double-processed

Conversation

@jnothman

@jnothman jnothman commented Oct 30, 2017 •

Copy link
Copy Markdown
Contributor

Subject: Avoid duplicate calls to autodoc-process-docstring

Feature or Bugfix

  • Bugfix

Purpose

Autosummary appears to be emitting 'autodoc-process-docstring' on docstrings that have already been processed by 'autodoc-process-docstring'. It does so by calling Documenter.add_content, which calls its process_doc, and then immediately calling process_doc on the output. This PR removes the second call.

I do not yet have a test, and advice on constructing one is welcome.

Relates

@tk0miya

tk0miya commented Oct 31, 2017

Copy link
Copy Markdown
Member

@shimizukawa could you review this please?


documenter.add_content(None)
doc = list(documenter.process_doc([self.result.data]))
doc = self.result.data

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this fix is correct. Double calling process_doc is caused by leaving a call of process_doc which became unnecessary on #1444.

@shimizukawa shimizukawa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM ;)

@shimizukawa
shimizukawa merged commit db415ba into sphinx-doc:master Jan 8, 2018
shimizukawa added a commit that referenced this pull request Jan 8, 2018
@jnothman

jnothman commented Jan 8, 2018

Copy link
Copy Markdown
Contributor Author

I'm glad we agree!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants