PowerGridModel / power-grid-model

Python/C++ library for distribution power system analysis
Mozilla Public License 2.0
143 stars 30 forks source link

Resolve code smells from `clang-tidy` on C++ side #267

Open mgovers opened 1 year ago

mgovers commented 1 year ago

The clang-tidy action checks for static analyzer warnings (similarly to SonarCube). Currently, there are quite some checks that are disabled in the .clang-tidy file. Disabled warnings are prefixed - in the .clang-tidy file, e.g. -llvm-else-after-return disables the llvm-else-after-return check.

Note that some checks are more easily fixable than others! If you get stuck on one check, just move on to the next one! Check the list of easily fixable checks below.

Desired solution

It is good practice to fix only one check per pull request to keep the amount of changes manageable.

Compilation of checks

As mentioned above, some clang-tidy checks may be hard to fix, especially for people that are relatively new to C++. Here is a list of good starting points. Again, if you get stuck, don't focus too long on one check but just move on to the next one. There are plenty low hanging fruits left.

Suggestions for easily fixable checks

Known hard-to-fix checks

Below are a couple of issues that are hard to fix, may take some time, or require more extensive C++ knowledge.

mgovers commented 11 months ago

I removed the good-first-issue label because all easy-to-fix things were fixed and merged. the remaining issues require more extensive knowledge and/or a discussion about our own opinion on the smells