# Contributing
Focused bug reports and formatting fixtures are welcome.
profmt requires Rust 1.89 or newer. Run these checks from the repository root:
```sh
cargo fmt --check
cargo build --locked --release
cargo test --locked
```
The build and test commands are separate so a release build never runs the
test suite as a side effect.
## Formatting changes
Add one focused fixture for each layout rule that changes. Place the fixture
under the matching family in `tests/fixtures`.
The fixture suite treats every file as canonical output under
`tests/compatibility.toml`. Each fixture must format to itself byte for byte,
and formatting it with the default policy must keep every token except
comments and stray semicolons in the same order.
Option variants that the compatibility profile does not exercise are covered
by the inline cases in `tests/options.rs`.
The process-level tests in `tests/cli.rs` cover CLI behavior such as config
discovery, standard input, checks, traversal, and safe writes.
## Source layout
`src/options.rs` defines public policy. `src/doc.rs` contains the document
model and renderer. `src/format.rs` owns per-file formatter state, statement
lists, blank lines and comment placement, while `src/format/` groups layouts
by language family: the file header, declarations, fields, and literals.
The CLI lives in `src/cli.rs` and `src/cli/`. The project uses Rust 2024
sibling module files and does not use `mod.rs`.