Add CMake options for enabling clang-tidy static analysis checks during build
Add the following CMake options:
to control running of clang-tidy static analysis checks during build.
- The first toggles whether the checks should be run.
- The second toggles whether auto-fix should be enabled.
- The third allows customisation of the exact checks to be run.
The checks currently default to a single check:
just to test that things are working as expected.
Going forward, we can use the large set of possible checks to gradually improve the code.
Eventually we can establish a set of checks to run in the CI to test new/changed code.
for general info on clang-tidy, and
for the list of all currently supported checks.
- Enable the EVTGEN_RUN_CLANG_TIDY option when configuring the build and see that the modernize-use-nullptr check runs.
- Enable additionally the EVTGEN_CLANG_TIDY_FIX option and see that the code is auto-fixed during the checks.
- Set a variety of values for list of checks and see that the right checks run.
Reviewers: jback, kreps
Reviewed By: jback, kreps
Differential Revision: https://phab.hepforge.org/D80