Skip to main content

Module format

Module format 

Source
Expand description

Polyglot source formatting (Rust, TS, Python, C++, C#). resq format — polyglot formatter with a shared implementation that powers both the standalone command and the pre-commit format steps.

Design: each language exports format_<lang>(root, files, check) — pre-commit calls these on its staged file list and then restages; the CLI wrapper (resq format) calls them on an empty list, which tells each formatter to operate on the whole project.

Structs§

FormatArgs
Arguments for the format command.

Enums§

FormatOutcome
Outcome of a per-language format step.

Functions§

format_cpp
Format C/C++ files via clang-format.
format_csharp
Format C# via dotnet format.
format_python
Format Python files via ruff format.
format_rust
Format Rust files via cargo fmt (runs against the whole workspace when files is empty).
format_ts
Format JS/TS/JSON/CSS files via Biome (preferring biome over bunx --bun biome).
run
Executes the format command.