analyze#

Configure (if needed) and run static analysis.

clibra analyze --preset analyze           # all tools
clibra analyze clang-tidy --preset analyze  # one tool

Requires LIBRA_ANALYSIS to be ON in the preset’s CMake cache. Without a subcommand, runs the analyze umbrella target. With a subcommand, runs only the corresponding target. If a target is unavailable, clibra emits an error with the reason from the build system rather than a generic failure.

CMake equivalent#

cmake --build --preset <n> --target analyze

For tool-specific configuration (suppression files, extra args, etc.) see Static analysis.

Flag reference#

clibra analyze#

Configure (if needed) and run static analysis.

The resolved preset defaults to analyze if --preset is not given and no default is configured.

Requires LIBRA_ANALYSIS=ON in the preset’s CMake cache. Without a subcommand, runs the analyze umbrella target. With a subcommand, runs only the corresponding target (e.g. analyze-clang-tidy). Emits an error with the reason from the build system if the target is unavailable.

Usage: clibra analyze [OPTIONS] [COMMAND]

Subcommands:#

  • clibra analyze clang-tidy

  • clibra analyze clang-check

  • clibra analyze cppcheck

  • clibra analyze clang-format

  • clibra analyze cmake-format

Options:#

  • -j, --jobs <JOBS> — Parallel job count. Defaults to the # of logical CPUs

    Default value: 4

  • --fix — Attempt to apply fixes using the {clang-tidy,clang-check} tools, if they are run. Ignored for other tools

  • -k, --keep-going — Continue building after errors

  • -D <VAR=VALUE> — Forward -DVAR=VALUE to the CMake configure step when active. Ignored (with a warning) if the build directory exists and neither –reconfigure nor –fresh is given

  • -r, --reconfigure — Force the configure step even if the build directory exists

  • -f, --fresh — Reconfigure with a –fresh cmake build directory

clibra analyze clang-tidy#

Usage: clibra analyze clang-tidy [OPTIONS]

Options:#

clibra analyze clang-check#

Usage: clibra analyze clang-check [OPTIONS]

Options:#

clibra analyze cppcheck#

Usage: clibra analyze cppcheck [OPTIONS]

Options:#

clibra analyze clang-format#

Usage: clibra analyze clang-format [OPTIONS]

Options:#

clibra analyze cmake-format#

Usage: clibra analyze cmake-format [OPTIONS]

Options:#