poco icon indicating copy to clipboard operation
poco copied to clipboard

Clang tidy showcase

Open teksturi opened this issue 1 year ago • 2 comments

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 avatar Dec 16 '23 21:12 teksturi

@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?

matejk avatar Dec 17 '23 09:12 matejk

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.

obiltschnig avatar Dec 17 '23 09:12 obiltschnig