- Rust 1.85+ (
rustupor your preferred toolchain manager) - For container and hybrid mode testing: OrbStack (macOS) or Docker Engine (Linux)
cargo fmt --check && cargo clippy -- -D warnings && cargo test # run before pushing
cargo build
cargo test
cargo clippy -- -D warnings
cargo fmtRun a specific test module:
cargo test slot::tests
cargo test config::tests
cargo test env::tests
cargo test detect::testssrc/
├── main.rs entry point, command handlers (init/up/down/ls)
├── cli.rs clap CLI definitions
├── config.rs .ecluse.toml parsing and Config struct
├── slot.rs slot allocation logic
├── env.rs .env.ecluse generation
├── detect.rs mode auto-detection heuristics
├── state.rs session state with file locking
├── error.rs typed EcluseError variants
├── modes/ ModeHandler trait + container/host/hybrid impls
├── compose.rs docker-compose file parsing and interaction
├── docker.rs Docker CLI wrapper
├── postgres.rs host Postgres provisioning
└── worktree.rs git worktree management
- Open an issue first to discuss the approach.
- Add a new variant to
config::Modeanderror::EcluseErroras needed. - Implement
ModeHandlerin a new file undersrc/modes/. - Register it in
modes::get_handler. - Add detection signals in
detect.rsif the mode can be auto-detected. - Add unit tests alongside the new code.
Open an issue first. The current provider interface lives in postgres.rs — a trait abstraction will be introduced when a second provider is added.
- Keep commits focused — one logical change per commit.
- Run
cargo fmt --check && cargo clippy -- -D warnings && cargo testbefore pushing; CI enforces all three. - For bug fixes: a failing test that passes after the fix is ideal.
- For new features: unit tests are required, integration tests are a bonus.