Skip to content

Using :undoc-members: together with sphinx.ext.coverage is confusing #2468

Open
@scolby33

Description

@scolby33

I am using Sphinx with apidoc and coverage. apidoc automatically includes the :undoc-members: option for its generated source files. This is not a problem in itself, but when combined with sphinx.ext.coverage can lead to confusing behavior.

According to this Stack Overflow answer and personal testing, sphinx.ext.coverage counts members that have been included with :undoc-members: as "documented." This seems to me to be confusing and perhaps unintended.

There are two options for resolving this that I can see:

  1. Add an option to sphinx.ext.coverage to ignore members that are only documented via :undoc-members:.
  2. Add a warning to sphinx.ext.coverage's documentation pointing out this behavior.

Perhaps both of these should be implemented, but the second is certainly the simpler short-term solution.

EDIT: Note that this applies to using sphinx.ext.coverage without apidoc as well--that situation is only where I came across this problem.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions