2024-03-06 11:09:05 +13:00
|
|
|
% README.clang-tidy 2024-03-03
|
|
|
|
% Current as of latest clang-tidy-19 from Ubuntu 22.04 apt package
|
2023-12-28 08:20:19 +13:00
|
|
|
|
|
|
|
Requires cmake in "build" sub-directory with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON (for "build/compile_commands.json")
|
|
|
|
and -DCMAKE_BUILD_TYPE=Debug (so `assert()`s defined), and then make (for Qt generated includes).
|
|
|
|
|
|
|
|
In project root directory (warning, slow):
|
|
|
|
|
2024-03-06 11:09:05 +13:00
|
|
|
clang-tidy-19 backend/*.c frontend/*.c backend_qt/*.cpp frontend_qt/*.cpp -p build/compile_commands.json
|
2023-12-28 08:20:19 +13:00
|
|
|
|
|
|
|
For "backend_tcl", which has no "compile_commands.json", specify the tcl include directory, e.g.
|
|
|
|
|
2024-03-06 11:09:05 +13:00
|
|
|
clang-tidy-19 backend_tcl/*.c -- -I/usr/include/tcl8.6
|
2023-12-28 08:20:19 +13:00
|
|
|
|
|
|
|
Options are in ".clang-tidy" (in the project root directory). The excluded checks are
|
|
|
|
`clang-analyzer-security.insecureAPI.strcpy` (for `strcpy()`, `strcat()` etc), and
|
|
|
|
`clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling` (for `sprintf()`).
|
|
|
|
|
|
|
|
The test suite (cmake given -DZINT_TEST=ON) can also be analysed with an additional check disabled:
|
|
|
|
|
2024-03-06 11:09:05 +13:00
|
|
|
clang-tidy-19 backend/tests/*.c frontend/tests/*.c backend_qt/tests/*.cpp \
|
2023-12-28 08:20:19 +13:00
|
|
|
-checks='-clang-analyzer-optin.performance.Padding' -p build/compile_commands.json
|