-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix ament_clang_tidy #213
Fix ament_clang_tidy #213
Conversation
Maybe you can elaborate why removing existing options like |
The way the code in this PR sets up |
Hi @dirk-thomas, can you please take a look again? |
The current patch does multiple unrelated changes (e.g. change semantic of the |
@mm318 friendly ping |
I will get to it before end of next week. Thanks. |
@mm318 any status updates on this? |
1 similar comment
@mm318 any status updates on this? |
I have updated the pull request by reducing the amount of changes. |
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
…ill a no-op) Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
@mm318 Thanks for contributing! Can you plz include more information on the PR description about the final list of changes this PR introduces, how to test and what to expect from testing? |
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
return 1 | ||
|
||
bin_names = [ | ||
'clang-tidy', | ||
# 'clang-tidy', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only use clang-tidy
6.0 for now, because it is the most ubiquitous, the default version of clang-tidy
on Ubuntu Bionic seems to be a moving target, and the parsing of linter warning/error messages has very recently been made difficult by an update to the default version of clang-tidy
on Ubuntu Bionic. This is also consistent with instructions in the README that's part of this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master branch is not targeting Ubuntu Bionic anymore but Ubuntu Focal. And the default version of clang-tidy
in Focal is 10.0. So I am not sure it makes sense to target version 6 here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the master
branch be backported to the branches that target Ubuntu Bionic, for example for the Dashing distro? Since the clang-tidy-6.0
apt package is valid for both Ubuntu Bionic and Focal, I think we should stick with clang-tidy
6.0 for now, then maybe backport, then target clang-tidy
10.0 (along with other features that I have in mind for this package).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes need to be explicitly backport through PRs. It won't happen automatically.
Using version 10 on Focal should happen before the upcoming freeze date. I don't mind which way that happens (target version 10 in this PR and then make a backport PR for Eloquent / Dashing which uses version 6) orland this PR targeting 6 and followingup with a PR to switch to version 10 with the intention to only backport the first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's land this PR targeting clang-tidy
6.0, with a follow-up PR to switch to clang-tidy
10.0.
Hi @claireyywang, I have updated the pull request description with more information. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got a KeyError
when testing on demos
repo, traceback see below:
Traceback (most recent call last):
File "/home/claire/ros2_ws/install/ament_clang_tidy/bin/ament_clang_tidy", line 11, in <module>
load_entry_point('ament-clang-tidy', 'console_scripts', 'ament_clang_tidy')()
File "/home/claire/ros2_ws/build/ament_clang_tidy/ament_clang_tidy/main.py", line 198, in main
report[current_file].append(copy.deepcopy(data))
KeyError: '/usr/share/opensplice/cmake/../../../include/opensplice/dcps/C++/SACPP/mapping/UFL.h'
Also the process took more than 5 mins to output all the warnings, is that expected?
Signed-off-by: Miaofei <miaofei@amazon.com>
Hi @claireyywang,
I have fixed the issue that you found.
Yes. It takes this long because the Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for merging! |
np! |
Changes made
How to use/test
Follow the README to install necessary dependencies (for example on Ubuntu 18.04, do
apt install clang-tidy-6.0 clang-tools-6.0 python-yaml
).In a workspace that contains the packages that you want to lint (or want to test the linter on):
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ament_clang_tidy build/
stdout
ament_clang_tidy build/ --xunit-file test.xml
stdout
test.xml
file