README.clang-tidy 1.1 KB

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