Skip to content

Commit d12556e

Browse files
committed
Add release note and documentation for #312
1 parent b4c75f7 commit d12556e

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

autoapi/_mapper.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ def _link_objs(value):
230230

231231
# Strip off the extra "\ "
232232
return result[:-2]
233-
233+
234+
234235
def _path_matches_patterns(path, patterns):
235236
"""Check if a path matches one of multiple patterns
236237
@@ -325,13 +326,17 @@ def find_files(patterns, dirs, ignore):
325326
for _dir in dirs: # iterate autoapi_dirs
326327
for root, subdirectories, filenames in os.walk(_dir):
327328
# skip directories if needed
328-
for sub_dir in subdirectories.copy():
329+
for sub_dir in subdirectories.copy():
329330
# iterate copy as we adapt subdirectories during loop
330-
if _path_matches_patterns(os.path.join(root, sub_dir), ignore) == True:
331+
if (
332+
_path_matches_patterns(os.path.join(root, sub_dir), ignore)
333+
== True
334+
):
331335
LOGGER.info(
332336
colorize("bold", "[AutoAPI] ")
333337
+ colorize(
334-
"darkgreen", f"Ignoring directory: {root}/{sub_dir}/")
338+
"darkgreen", f"Ignoring directory: {root}/{sub_dir}/"
339+
)
335340
)
336341
# adapt original subdirectories inplace
337342
subdirectories.remove(sub_dir)
@@ -351,7 +356,8 @@ def find_files(patterns, dirs, ignore):
351356
LOGGER.info(
352357
colorize("bold", "[AutoAPI] ")
353358
+ colorize(
354-
"darkgreen", f"Ignoring file: {root}/{filename}")
359+
"darkgreen", f"Ignoring file: {root}/{filename}"
360+
)
355361
)
356362
continue
357363

docs/changes/312.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Can exclude directories from being documented

docs/reference/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Customisation Options
9090

9191
Default: ``['*migrations*']``
9292

93-
A list of patterns to ignore when finding files.
93+
A list of patterns to ignore when finding directories and files to document.
9494

9595
.. confval:: autoapi_root
9696

0 commit comments

Comments
 (0)