This file provides guidance to Claude Code when working with this repository.
action-format is a GitHub Actions workflow formatter written in Rust. Cargo workspace with:
crates/action-format- CLI binarycrates/action-format-cli- CLI argument parsingcrates/action-format-core- Core formatting logic
Do not add too many comments. Only add comments where necessary, if the code is complicated and cannot be simplified.
cargo build
cargo nextest run
cargo fmt
cargo run -p action-format
prek run -a # Run pre-commit hookslib.rs- Public API exportsconfig.rs- Formatter configurationformatter.rs- Core formatting logic (line-based parsing)parser.rs- Error types
lib.rs- CLI argument structs with clap
main.rs- Entry point, finds workflows in.github/workflowsprinter.rs- Output abstraction (stdout/stderr with quiet mode)
Uses line-based parsing rather than a full YAML parser to preserve comments naturally. Tracks indentation levels, detects steps: sections, and normalizes accordingly.
- Edition 2024, MSRV 1.90
- Strict clippy pedantic enabled
- Use Printer abstraction instead of direct print! calls