-
Notifications
You must be signed in to change notification settings - Fork 676
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
test(clang-tidy): test if workflow fails only when it reports errors #7749
Conversation
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Also we need a clang-tidy-all workflow too, not just differential. To check for all the files in the repository, before making it required. |
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Running it on this file: On CIThis command: On the CI machine, generated these errors:
These are wrong results, at least the first warning is wrong:
But when I run it on my machine:$ clang-tidy -p=build/ -export-fixes fixes.yaml src/universe/autoware.universe/map/map_loader/test/test_pointcloud_map_loader_module.cpp
22593 warnings and 1 error generated.
Error while processing /home/mfc/projects/autoware/src/universe/autoware.universe/map/map_loader/test/test_pointcloud_map_loader_module.cpp.
/home/mfc/projects/autoware/src/universe/autoware.universe/map/map_loader/test/test_pointcloud_map_loader_module.cpp:33:7: warning: constructor does not initialize these fields: node, temp_pcd_path [cppcoreguidelines-pro-type-member-init]
class TestPointcloudMapLoaderModule : public ::testing::Test
^
/opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:152:10: error: 'csignal' file not found [clang-diagnostic-error]
#include <csignal>
^~~~~~~~~
Suppressed 22609 warnings (22592 in non-user code, 17 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s). I can't figure out why these are different. clang-tidy versions are same, they both use the old |
Signed-off-by: veqcc <[email protected]>
clang-tidy differential will fail due to Added: Could clone this test PR and move on to review autowarefoundation/autoware-github-actions#306 ? |
@xmfcx My thought is that false positives in static analysis tools are inevitable. When we face a false positive with higher severity in the future, then let's find a way to avoid it. My idea is forcing developers to avoid those false positives even if the program is correct, because such kind of programs tend to be complicated and have low readability/maintainability. |
I'm not talking about the error specifically. I have pointed out that it behaves differently on CI than on my machine. When you run |
Sorry, I was misunderstaing your point. I have tested on my local machine:
clang-tidy is the default version with
|
The version is same for me:
I've never got that one before 😕 |
Sorry, I have forgotten I changed the compile_commands.json based on https://github.com/orgs/autowarefoundation/discussions/4876#discussioncomment-9921675 I will test with the original compile_commands.json again 🙇 Added: |
After I have build
I still got the same warnings
|
Description
Related links
Related PR:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.