File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
ament_clang_tidy/ament_clang_tidy Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,11 @@ def is_gtest_source(file_name):
162162 def is_unittest_source (package , file_path ):
163163 return ('%s/test/' % package ) in file_path
164164
165+ def is_protobuf_source (file_name ):
166+ if (file_name .endswith (".pb.cc" ) or file_name .endswith (".pb.h" )):
167+ return True
168+ return False
169+
165170 def start_subprocess (full_cmd ):
166171 output = ''
167172 try :
@@ -188,6 +193,10 @@ def start_subprocess(full_cmd):
188193 if is_unittest_source (package_name , item ['file' ]):
189194 continue
190195
196+ # exclude auto-generated protobuf sources from being checked by clang-tidy
197+ if is_protobuf_source (os .path .basename (item ['file' ])):
198+ continue
199+
191200 files .append (item ['file' ])
192201 full_cmd = cmd + [item ['file' ]]
193202 async_outputs .append (pool .apply_async (start_subprocess , (full_cmd ,)))
You can’t perform that action at this time.
0 commit comments