Add static code analysis workflow with Cppcheck#1161
Conversation
|
Cool! Thanks for working on this. I see you marked this as draft. Do you plan to resolve more of the findings? If so, let me know if you need any help. |
-1 is equivalent to string::npos, but that is the parameter default and not needed.
|
Sorry for the late reply, I caught a cold and hence was offline. Thanks for your help @ddennedy and the offer @bmatherly ! |
97207aa to
85f9e64
Compare
|
You can move some things to the config file. See https://cppcheck.sourceforge.io/reference-cfg-format.pdf |
|
P.S. I am going to make a release in a couple of days, which is one reason I moved this along. |
I'm not saying it is better. Just more "complete". I think we want cmake to be a first-class-citizen. And I know many projects have moved to using it. If someone is using cmake, they will not "discover" the cppcheck analysis - which has now become a requirement for code submission.
Will do. Thanks. |

This adds a GitHub Workflow to run Cppcheck static code analysis. Despite the name Cppcheck also supports not only C++ but also C.
The results are not only visible in the log but also exported as GitHub Annotations.
Yet the job fails because Cppcheck finds some issues. These have to be reviewed now and either fixed or set to be ignored (in case of false positives).