Development Setup¶
Prerequisites¶
- Rust 1.74+ — install via rustup
- cargo — included with Rust
- Git
Optional tools:
- cargo-watch —
cargo install cargo-watch— auto-rebuild on file changes - MkDocs Material —
pip install mkdocs-material— build the documentation site
Clone the repository¶
Build¶
# Debug build (fast, includes debug symbols)
make build
# Release build (optimised)
make build-release
# Library only
make build-lib
# CLI only
make build-cli
Run the tests¶
This runs all unit tests and integration tests.
Run a specific test¶
# Run a specific test by name
cargo test test_parse_options_block
# Run tests with output (including println! output)
cargo test -- --nocapture
Full quality gate¶
This runs in sequence:
cargo fmt --all— formattingcargo clippy --all-targets --all-features -- -D warnings— lintingcargo test --all— tests
All three must pass before a PR is accepted.
Code formatting¶
Linting¶
Hornet enforces pedantic clippy with module_name_repetitions allowed. Fix all warnings
before opening a PR.
Build the MkDocs documentation¶
# Install documentation dependencies via Poetry (one-time)
make docs-install
# Serve documentation locally with live reload
make docs-serve
# Build the static site
make docs
Project layout¶
hornet/
├── Cargo.toml # Single-crate manifest (lib + optional CLI binary)
├── Makefile # Developer shortcuts
├── README.md
├── src/
│ ├── ast/ # AST types
│ ├── parser/ # Winnow parsers
│ ├── writer/ # Serialisers
│ ├── validator/ # Semantic checks
│ ├── error.rs
│ ├── lib.rs # Public API surface
│ └── main.rs # CLI binary (cli feature)
├── tests/ # Integration tests
│ ├── named_conf.rs
│ └── zone_file.rs
├── docs/ # MkDocs documentation
│ ├── mkdocs.yml
│ └── src/
└── .github/
└── workflows/
Next Steps¶
- Testing — Test organisation and how to add new tests
- Contributing — How to contribute to Hornet