Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrofit a new version of cpplint. Ignore Qt generated moc_ files. #501

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ament_clang_tidy/ament_clang_tidy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def is_gtest_source(file_name):
return True
return False

def is_moc_generated(file_name):
if file_name.startswith('moc_') and file_name.endswith('.cpp'):
return True
return False

def is_unittest_source(package, file_path):
return ('%s/test/' % package) in file_path

Expand Down Expand Up @@ -186,6 +191,10 @@ def start_subprocess(full_cmd):
if is_gtest_source(os.path.basename(item['file'])):
continue

# exclude Qt moc generated files from being checked by clang-tidy
if is_moc_generated(os.path.basename(item['file'])):
continue

# exclude unit test sources from being checked by clang-tidy
# because gtest macros are problematic
if is_unittest_source(package_name, item['file']):
Expand Down
Loading