Skip to content

Commit 8e87eb1

Browse files
committed
fix: catch error infos when clang-tidy fails, also return 1 when fails.
1 parent 87d12c6 commit 8e87eb1

File tree

1 file changed

+4
-0
lines changed
  • ament_clang_tidy/ament_clang_tidy

1 file changed

+4
-0
lines changed

ament_clang_tidy/ament_clang_tidy/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def start_subprocess(full_cmd):
180180
print('The invocation of "%s" failed with error code %d: %s' %
181181
(os.path.basename(clang_tidy_bin), e.returncode, e),
182182
file=sys.stderr)
183+
output = e.output.decode()
183184
return output
184185

185186
files = []
@@ -268,6 +269,9 @@ def start_subprocess(full_cmd):
268269
with open(args.xunit_file, 'w') as f:
269270
f.write(xml)
270271

272+
if output:
273+
sys.exit(1)
274+
271275

272276
def find_executable(file_names):
273277
paths = os.getenv('PATH').split(os.path.pathsep)

0 commit comments

Comments
 (0)