-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Modernize with clang-tidy from base subprojects [PCL-2731] #4560
Modernize with clang-tidy from base subprojects [PCL-2731] #4560
Conversation
@kunaltyagi Per @SergioRAgostinho I replaced #4249 with the first of what will be a series of much smaller PRs to introduce |
@kunaltyagi CI is green for this PR as well |
Shoudn't |
@Morwenn That was done intentionally to limit the scope of For contrast, see #4249 where |
Oh, my bad then. |
The addition of the |
That's the intent; @kunaltyagi wanted to prevent back-sliding in code that's already been tidied. You can see some of the discussion in #4249 |
It looks fine for me. I'm just wondering, if this action doesn't run succesfully for a PR, would it then "block" the PR? There is however some difference for the I/O module on latest run on your branch @gnawme. In https://github.com/gnawme/pcl/actions/runs/451637712
Missing those? |
@larshg Yes, @SergioRAgostinho asked me to remove unnecessary default constructs/destructors in the previous PR, perhaps I can do that when I add |
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.
Code changes LGTM. Just a few questions on the surrounding infra.
Apologies, but I had to be away for a while, and have lost the original context of the PR
Just note: Here was the decision not to add |
That's true. But the CppCoreGuidelines reaffirmed their position isocpp/CppCoreGuidelines#1448 (in 2019, that discussion is from 2018, and @taketwo says the Core Guidelines position is prefered). The new PR says: even dtors should have one of
|
We are using I just would prefer to have these modernizations in separate PRs like in #2731, as we can apply them to the whole project once. And this PR should be for enabling the checks on the CI. Imho we should enable this not just for some modules first. Instead for the whole project and than add fixed categories one by one (we just have to exclude 3rd party code somehow - maybe move the 3rd party code to a separate dir in the root project?) |
In that case,
To confirm, you are advising splitting this PR into 2 parts:
If code reorganization is needed, it'd get quite messy. It might be better to have multiple CI workflows, each with their "exception"-list and config till we manage to bring order. If we delay clang-tidy due to code re-organization, I fear we might not end up with either of them. Moreover, the piece-meal approach will give us insight into any commonality between the workflows and help in re-organization |
Yep as otherwise we end like with clang-format: Some parts of the project are modernized, other not. As already most important changes are done via #2731 this should be mostly only smaller PRs now in preparation for including it in the CI.
Indeed. Maybe it works to add //Edit: Ah well, I see you don't check the messages from Clang-Tidy. Instead you are applying |
Let's get the low hanging fruits first :) Could you take the lead on the first 2 parts of "get clang-tidy warnings, deduplicate them and than format them into a format Azure understand" given your experience (or if the project is open source, link the jenkins file for reference)? @gnawme Sorry for all the chatter, I'll summarize the actionable items for you :). Based on @SunBlack's recommendation, please split the PR in two parts:
|
The project we are using is Jenkins Warnings Next Generation Plugin and the file it can parses from Clang-Tidy are like here. Not sure: You can tell //Edit: Found this - this could be already that what we want. |
|
That's not what I meant. Essentially, simply split this PR in 2 parts:
|
3a6478a
to
2619912
Compare
@kunaltyagi OK, I removed the Github workflows to be restored in the future (or perhaps replaced by what @SunBlack has in mind). |
2619912
to
24e9f4b
Compare
Signed-off-by: Norm Evangelista <norm.evangelista@gmail.com>
Signed-off-by: Norm Evangelista <norm.evangelista@gmail.com>
Signed-off-by: Norm Evangelista <norm.evangelista@gmail.com>
Signed-off-by: Norm Evangelista <norm.evangelista@gmail.com>
Signed-off-by: Norm Evangelista <norm.evangelista@gmail.com>
24e9f4b
to
da1cfd6
Compare
Kinda. But in reverse. Could you make a PR which has a github workflow for clang-tidy with no checks? |
@@ -0,0 +1,2 @@ | |||
--- | |||
Checks: '-*,modernize-deprecated-headers,modernize-redundant-void-arg,modernize-replace-random-shuffle,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nullptr,modernize-use-override,modernize-use-using' |
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.
Should we add the following:
WarningsAsErrors: '#same content as in checks, but for errors'
Sure; what are you trying to accomplish, exactly? #4249 has checks for the entire project; if I remove the GitHub workflows from the PR, will that accomplish your latter aim? BTW, who approved |
You could run clang-tidy with all checks and add all checks which doesn't show an issue already to the workflow. |
Initial modernization of code base using
clang-tidy
and an innocuous subset of itsmodernize
checks:This PR supersedes #4249, which was much too large for sensible review.
It takes the approach of starting at the base of the PCL dependency graph, and only applying
clang-tidy
in those subprojects.https://user-images.githubusercontent.com/1709142/87282880-fd5cc080-c4f4-11ea-878e-9c7de9c71eb8.png