File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 2626from typing import TYPE_CHECKING , cast
2727
2828from sphinx .util .inventory import _InventoryItem
29+ from sphinx .util .logging import getLogger
2930
3031if TYPE_CHECKING :
3132 from sphinx .application import Sphinx
@@ -167,6 +168,21 @@ def autodoc_process_signature(
167168 return signature , return_annotation
168169
169170
171+ logger = getLogger ("trio" )
172+
173+
174+ def autodoc_process_docstring (
175+ app : Sphinx ,
176+ what : str ,
177+ name : str ,
178+ obj : object ,
179+ options : object ,
180+ lines : list [str ],
181+ ) -> None :
182+ if not lines :
183+ logger .warning (f"{ name } has no docstring" )
184+
185+
170186# XX hack the RTD theme until
171187# https://github.com/rtfd/sphinx_rtd_theme/pull/382
172188# is shipped (should be in the release after 0.2.4)
@@ -175,6 +191,8 @@ def autodoc_process_signature(
175191def setup (app : Sphinx ) -> None :
176192 app .add_css_file ("hackrtd.css" )
177193 app .connect ("autodoc-process-signature" , autodoc_process_signature )
194+ app .connect ("autodoc-process-docstring" , autodoc_process_docstring )
195+
178196 # After Intersphinx runs, add additional mappings.
179197 app .connect ("builder-inited" , add_intersphinx , priority = 1000 )
180198 app .connect ("source-read" , on_read_source )
You can’t perform that action at this time.
0 commit comments