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 26
26
from typing import TYPE_CHECKING , cast
27
27
28
28
from sphinx .util .inventory import _InventoryItem
29
+ from sphinx .util .logging import getLogger
29
30
30
31
if TYPE_CHECKING :
31
32
from sphinx .application import Sphinx
@@ -167,6 +168,21 @@ def autodoc_process_signature(
167
168
return signature , return_annotation
168
169
169
170
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
+
170
186
# XX hack the RTD theme until
171
187
# https://github.com/rtfd/sphinx_rtd_theme/pull/382
172
188
# is shipped (should be in the release after 0.2.4)
@@ -175,6 +191,8 @@ def autodoc_process_signature(
175
191
def setup (app : Sphinx ) -> None :
176
192
app .add_css_file ("hackrtd.css" )
177
193
app .connect ("autodoc-process-signature" , autodoc_process_signature )
194
+ app .connect ("autodoc-process-docstring" , autodoc_process_docstring )
195
+
178
196
# After Intersphinx runs, add additional mappings.
179
197
app .connect ("builder-inited" , add_intersphinx , priority = 1000 )
180
198
app .connect ("source-read" , on_read_source )
You can’t perform that action at this time.
0 commit comments