poco
poco copied to clipboard
Clang tidy showcase
This PR is just showcase what kind of things clang-tidy could do. So I am not suggesting we take all of these checks in use. Currently not buildable as it makes mistakes with some cases. It did also found many bugs. I have to send fixes to those first before doing real clang-tidy things.
We just need to get these thing automated so they do not happened again. Note that these are only checks which clang-tidy can fix automatically. There is also bunch of good checks which can give just warning.
This was done for #4348
@teksturi, this is excellent!
How would clang-tidy be automated?
Shall it be added as the last build target in CMake and make the build fail?
Or is it safe for automatic fixes to be applied also?
We should enable clang-tidy checks as part of normal CI. In the first step, just print the warnings but not fail. After all things are fixed, make the build step fail if clang-tidy reports issues. Probably need to clarify what warnings or errors would cause the build to fail also (maybe some are acceptable/unavoidable). I don't want automatic fixes for now.