Static analysis tools usually needs a
If you use Meson to build JackTrip, it already created this file in your build
If you only want to run basic static analysis on JackTrip, you can install scan-build. Meson will automatically generate a scan-build target for you:
ninja -C builddir scan-build
This should never show any warnings or errors.
If you installed clang-tidy and
.clang-tidy file in the project directory,
Meson generates a clang-tidy target, too.
.clang-tidy file defines which checks
should be run.
Running clang-tidy on the entire code base:
ninja -C builddir clang-tidy
In most cases you want to run clang-tidy on single files.
cd src run-clang-tidy.py -j 4 -p ../builddir singlefile.cpp
# specifies the number of tidy instances that run in parallel.
For some checks clang-tidy offers automatic fixes. Some of these are save to apply without worries. Others should be checked afterwards.
run-clang-tidy.py -fix -j 4 -p ../builddir singlefile.cpp