Add Sanitizers and convenience tools
I'll bundle a couple of things in here, as they are kind of related.
I've come around integrating Sanitizers finally into elsa.
With the compile flag
ELSA_SANITIZER, it is possible to set it to Address, Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'. But Memory and MemoryWithOrigins are (to my knowledge) only available with clang.
- Which ones should we be using on a regular basis in the pipeline?
- What is the regular basis? A nightly or for every branch? (My concern is memory consumption, as it is higher as for "normal" builds)
I've found a way to integrate clang-tidy into CMake. So it could be switched on with a compile flag. And as we are expecting build to pass the clang-tidy checks, we could add
WarningsAsErrors: '*' to
.clang-tidy and the build would automatically fail in the build stage.
What you think about that?
clang-format as CMake target
The same way as clang-tidy, clang-format can be used as a make target. So you could format you're codebase with something like
This is a nice tool which is a formatting and linting tool for CMake. I would similarly setup a CMake target
format-cmake as for clang-format.
We would need to initially format our CMakeLists.txt files and then a similar check as for clang-format in the pipeline.
What you think about these things? My priority are the sanitizers, but the others are not too complicated so I would tackle them together.
- Sanitizers (merge request 71)
- clang-tidy and clang-format