Skip to main content

Crate cabin_fmt

Crate cabin_fmt 

Source
Expand description

clang-format runner used by Cabin’s developer-tools commands.

This crate keeps formatting-specific executable resolution, command-line construction, and exit-status handling outside cabin, mirroring the crate boundaries used by cabin-tidy.

Crate boundaries:

  • the crate owns formatter executable resolution and the clang-format command-line shape;
  • it accepts typed inputs (FormatRequest) and emits typed outcomes (FormatReport);
  • it never walks the filesystem looking for sources — that job belongs to cabin-source-discovery;
  • it never reads Cabin’s configuration files — the orchestration layer threads any config-derived inputs through the typed FormatRequest.

Structs§

FormatRequest
Input for run_formatter.

Enums§

ExitStatusKind
Exit-status classification, shared with cabin-tidy so the two external-tool runners report process outcomes the same way. Stringified exit-status kind preserved so the orchestration layer can decide whether to display an exit code or a signal.
FormatError
Errors surfaced by the runner.
FormatMode
Operation mode the runner should perform.
FormatReport
Per-mode outcome of run_formatter.

Functions§

resolve_formatter_executable
Resolve the formatter executable Cabin should spawn.
run_formatter
Run clang-format over the requested files.