format#

Configure (if needed) and check/apply formatting.

clibra format --preset format           # all tools
clibra format -c clang --preset format  # one tool

Requires LIBRA_FORMAT to be ON in the preset’s CMake cache. Without a subcommand, runs the format 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 format

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

Flag reference#

clibra format#

Configure (if needed) and check/apply formatting.

Requires LIBRA_FORMAT=ON in the preset’s CMake cache. The preset defaults to format if not given.

Attempts to apply formatting by default. Has suboptions for checking formatting.

Usage: clibra format [OPTIONS]

Options:#

  • -D <VAR=VALUE>

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

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

  • -c, --check <CHECK> — The check to run. Defaults to nothing

    Possible values: clang, cmake

  • -k, --keep-going — Continue building after errors. Only valid with {Ninja, Unix Makefiles} generators