Format
Run code formatters to automatically fix code style.
Steps
- •
Detect the project type and find the format command:
- •Nix with treefmt:
nix fmt - •TypeScript/JavaScript:
prettier --write,biome format --write - •Go:
gofmt -w,goimports -w - •Rust:
cargo fmt - •Python:
black,ruff format
- •Nix with treefmt:
- •
If treefmt is configured in the project, prefer
nix fmtas it handles all formatters. - •
If no formatter is configured, propose adding one appropriate for the project.
- •
Run the command to format the code.