-
Notifications
You must be signed in to change notification settings - Fork 915
Add clang-tidy checks and apply them #1989
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
Conversation
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
|
@pcarruscag I would like to get your opinion about following checks since they are related to code style and changes many things https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html -> This can be disabled for short ones. Needs to decide short is how many characters. https://clang.llvm.org/extra/clang-tidy/checks/readability/else-after-return.html https://clang.llvm.org/extra/clang-tidy/checks/readability/isolate-declaration.html May be this is too https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-auto.html If chosen those ones can be applied just before release v8. to avoid merge conflicts |
e3c4d2c to
e5646f7
Compare
6d505d0 to
fc06604
Compare
|
Else after return is fine but I don't like the others. |
| } | ||
|
|
||
| void CFEMStandardElementBase::IntegrationPointsTriangle(void) { | ||
| void CFEMStandardElementBase::IntegrationPointsTriangle() { |
Check warning
Code scanning / CodeQL
Poorly documented large function
| } | ||
|
|
||
| void CFEMStandardElementBase::IntegrationPointsTetrahedron(void) { | ||
| void CFEMStandardElementBase::IntegrationPointsTetrahedron() { |
Check warning
Code scanning / CodeQL
Poorly documented large function
|
|
||
| Xcoord.push_back(Airfoil_Coord[0]); | ||
| Ycoord.push_back(Airfoil_Coord[1] * factor * AirfoilScale); | ||
| Ycoord.emplace_back(Airfoil_Coord[1] * factor * AirfoilScale); |
Check failure
Code scanning / CodeQL
Missing return-value check for a 'scanf'-like function
|
I went over the changes very quickly, if someone else wants to take a look it would be nice. |
|
@bigfooted, @tbellosta, @WallyMaier if any of you had time I would be great. |
I've had a look at the changes. I do not have strong opinions about the checks that were chosen (or not chosen), but I am glad that we have this now. |
bigfooted
left a comment
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.
Great work!
Proposed Changes
clang-tidy is a well-known tool. This PR adds clang-tidy file with common checks and applies to the code base.
PR Checklist