When WarningsAsErrors is specified in .clang-tidy, this can lead to some failures in result reporting. Specifically, the following test program (src/factorial.cpp):
int Factorial(int n) {
int result = 1;
int fake = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
return result;
}
fails with this output:
The invocation of "clang-tidy" failed with error code 1: Command '['/usr/bin/clang-tidy', '-p', 'path/test_examples_cmake', '--header-filter', 'include/test_examples_cmake/.*', 'path']' returned non-zero exit status 1.
when running ament_clang_tidy.
After applying this fix, I get the following output, which is expected
By trying to access the output attribute of the raised exception, we can populate the output in cases where exceptions were raised and there was valid output.
This is an automatic backport of pull request #397 done by Mergify.
Issue Summary
When
WarningsAsErrors
is specified in.clang-tidy
, this can lead to some failures in result reporting. Specifically, the following test program (src/factorial.cpp):fails with this output:
when running
ament_clang_tidy
.After applying this fix, I get the following output, which is expected
Relevant section of
.clang-tidy
, for reference:Fix
By trying to access the
output
attribute of the raised exception, we can populate the output in cases where exceptions were raised and there was valid output.This is an automatic backport of pull request #397 done by Mergify.