Menu

[e18b04]: / README.clang-tidy  Maximize  Restore  History

Download this file

23 lines (14 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
% README.clang-tidy 2025-02-15
% Current as of latest clang-tidy-20 from Ubuntu 24.04 apt package

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):

clang-tidy-20 backend/*.c frontend/*.c backend_qt/*.cpp frontend_qt/*.cpp -p build/compile_commands.json

For "backend_tcl", which has no "compile_commands.json", specify the tcl include directory and package define, e.g.

clang-tidy-20 backend_tcl/*.c -- -I/usr/include/tcl8.6 -DPACKAGE_VERSION='"2.14.0"'

Options are in ".clang-tidy" (in the project root directory). The excluded check is
`clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling` (for `sprintf()`).

The test suite (cmake given -DZINT_TEST=ON) can also be analysed with additional checks disabled:

clang-tidy-20 backend/tests/*.c frontend/tests/*.c backend_qt/tests/*.cpp \
    -checks='-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding' \
    -p build/compile_commands.json
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.