Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Overriding the <code>autodoc-process-docstring</code> event (as noted by @delnan) can help, by adding the following to <code>conf.py</code>:</p> <pre><code># set up the types of member to check that are documented members_to_watch = ['function',]; def warn_undocumented_members(app, what, name, obj, options, lines): if(what in members_to_watch and len(lines)==0): # warn to terminal during build print "Warning: ", what, "is undocumented: ", name, "(%d)"% len(lines); # or modify the docstring so the rendered output is highlights the omission lines.append(".. Warning:: %s '%s' undocumented" % (what, name)); </code></pre> <p>And then connect this function to the event (from an answer in <a href="https://stackoverflow.com/questions/3757500/how-do-i-connect-sphinxs-autodoc-skip-member-to-my-function">this SO thread</a>):</p> <pre><code>def setup(app): app.connect('autodoc-process-docstring', warn_undocumented_members); </code></pre> <p>To turn on (off) the warnings include (exclude) the undoc-members -- globally with <code>autodoc_default_flags</code> in <code>conf.py</code>, or with both the directives as in the question.</p> <pre><code>autodoc_default_flags = ['members', 'undoc-members' ] #autodoc_default_flags = ['members' ] </code></pre> <p><strong>EDIT:</strong></p> <p>I attempted to extend this approach to generate just the undoc members, by the following method:</p> <ul> <li>conditionally set a property, say, <code>warn_undoc=True</code>, on the object during during the function <code>warn_undocumented_members</code> (above)</li> <li>attach a second override function to the preprocessor event <code>autodoc-skip-member</code> that skipped all members if they did <em>not</em> have <code>warn_undoc</code> set.</li> </ul> <p>However, further investigation rules this approach out, because <code>autodoc-skip-member</code> occurs for each group of members before <code>autodoc-process-docstring</code> occurs. Thus, the properties are set too late to conditionally skip based on presence/absence of docstrings.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload