Skip to content

Commit

Permalink
remove AMENT_IGNORE check in clang-tidy when looking for compilation …
Browse files Browse the repository at this point in the history
…db (#441)

* remove AMENT_IGNORE check in clang-tidy when looking for compilation database

* add comment explaining why we don't check for AMENT_IGNORE

Signed-off-by: Alberto Soragna <[email protected]>
  • Loading branch information
alsora authored Nov 5, 2023
1 parent 7a5876e commit 1633932
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ament_clang_tidy/ament_clang_tidy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ def get_compilation_db_files(paths):
for path in paths:
if os.path.isdir(path):
for dirpath, dirnames, filenames in os.walk(path):
if 'AMENT_IGNORE' in dirnames + filenames:
dirnames[:] = []
continue
# NOTE: here we don't check for the AMENT_IGNORE file.
# This function tries to find compile_commands.json file in the build folders.
# Build folders always include a AMENT_IGNORE file, so checking for it would
# result in not finding any compilation db. The check would also be redundant
# because if a source folder was marked with AMENT_IGNORE, then
# the compile_commands.json will not be present in relevant build folder.

# ignore folder starting with . or _
dirnames[:] = [d for d in dirnames if d[0] not in ['.', '_']]
dirnames.sort()
Expand Down

0 comments on commit 1633932

Please sign in to comment.