Skip to content

Commit

Permalink
fix: catch error infos when clang-tidy fails, also return 1 when fails.
Browse files Browse the repository at this point in the history
Signed-off-by: WU MENGHUNG <[email protected]>
  • Loading branch information
wuisky committed Sep 8, 2023
1 parent 6d1766f commit 15d5c2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ament_clang_tidy/ament_clang_tidy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def start_subprocess(full_cmd):
print('The invocation of "%s" failed with error code %d: %s' %
(os.path.basename(clang_tidy_bin), e.returncode, e),
file=sys.stderr)
output = e.output.decode()
return output

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

if output:
sys.exit(1)


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

0 comments on commit 15d5c2c

Please sign in to comment.