Skip to content

Commit

Permalink
Exclude test and doc from interface search
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent committed Mar 29, 2024
1 parent 9f7cab2 commit 3e6ca96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rosdoc2/verbs/build/generate_interface_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@

def _find_files_with_extension(path, ext):
# Partly adapted from https://github.com/ros-infrastructure/rosdoc_lite
# and https://stackoverflow.com/questions/19859840/excluding-directories-in-os-walk
matches = []
for root, _, filenames in os.walk(path):
excludes = ['test', 'doc']
for root, dirs, filenames in os.walk(path, topdown=True):
# exclude directories
dirs[:] = [d for d in dirs if d not in excludes]
for filename in fnmatch.filter(filenames, f'*.{ext}'):
matches.append((os.path.splitext(filename)[0], os.path.join(root, filename)))
return matches
Expand Down

0 comments on commit 3e6ca96

Please sign in to comment.