@@ -44,6 +44,15 @@ def in_stdlib(module_name: str) -> bool:
44
44
LOGGER = sphinx .util .logging .getLogger (__name__ )
45
45
46
46
47
+ def _color_info (msg : str ) -> None :
48
+ LOGGER .info (
49
+ colorize ("bold" , "[AutoAPI] " )
50
+ + colorize (
51
+ "darkgreen" , msg
52
+ )
53
+ )
54
+
55
+
47
56
def _expand_wildcard_placeholder (original_module , originals_map , placeholder ):
48
57
"""Expand a wildcard placeholder to a sequence of named placeholders.
49
58
@@ -330,12 +339,7 @@ def find_files(patterns, dirs, ignore):
330
339
for sub_dir in subdirectories .copy ():
331
340
# iterate copy as we adapt subdirectories during loop
332
341
if _path_matches_patterns (os .path .join (root , sub_dir ), ignore ):
333
- LOGGER .info (
334
- colorize ("bold" , "[AutoAPI] " )
335
- + colorize (
336
- "darkgreen" , f"Ignoring directory: { root } /{ sub_dir } /"
337
- )
338
- )
342
+ _color_info (f"Ignoring directory: { root } /{ sub_dir } /" )
339
343
# adapt original subdirectories inplace
340
344
subdirectories .remove (sub_dir )
341
345
# recurse into remaining directories
@@ -349,12 +353,7 @@ def find_files(patterns, dirs, ignore):
349
353
350
354
# Skip ignored files
351
355
if _path_matches_patterns (os .path .join (root , filename ), ignore ):
352
- LOGGER .info (
353
- colorize ("bold" , "[AutoAPI] " )
354
- + colorize (
355
- "darkgreen" , f"Ignoring file: { root } /{ filename } "
356
- )
357
- )
356
+ _color_info (f"Ignoring file: { root } /{ filename } " )
358
357
continue
359
358
360
359
# Make sure the path is full
@@ -389,6 +388,14 @@ def output_rst(self, source_suffix):
389
388
def _output_top_rst (self ):
390
389
# Render Top Index
391
390
top_level_index = os .path .join (self .dir_root , "index.rst" )
391
+
392
+ modules = [obj for obj in self .all_objects .values ()
393
+ if obj .type == "module" and obj .docstring == "" ]
394
+ if modules and "undoc-members" not in self .app .config .autoapi_options :
395
+ _color_info ("The following modules have no top-level documentation, and so were skipped as undocumented:" )
396
+ for m in modules :
397
+ _color_info (f" { m .id } " )
398
+
392
399
pages = [obj for obj in self .objects_to_render .values () if obj .display ]
393
400
if not pages :
394
401
msg = (
0 commit comments