Add clang-tidy checks and apply them#1989
Conversation
There was a problem hiding this comment.
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. |
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