Skip to main content

Development Setup

Get the Bitloops codebase building and tests passing on your machine.

Prerequisites

  • Rust — install via rustup
  • Git — you probably have this already

That's it. SQLite and DuckDB are bundled — no external databases needed.

Clone and Build

# Fork the repo on GitHub, then:
git clone https://github.com/YOUR_USERNAME/bitloops.git
cd bitloops

# Check everything compiles
cargo check

# Build
cargo build

# Run
cargo run -- --version

Set Up Git Hooks

We have pre-commit hooks for formatting and linting:

./scripts/setup-hooks.sh

This installs:

  • Pre-commit — runs cargo fmt and cargo clippy
  • Pre-push — runs coverage checks against the baseline

Running Tests

We use four test aliases to keep things organized:

CommandWhat It Runs
cargo test-coreLibrary crate unit tests
cargo test-cliCLI/binary crate tests
cargo test-integrationIntegration tests in tests/
cargo test-allEverything

For a quick summary with coverage:

./scripts/test-summary.sh --coverage

Test Coverage

We use cargo-llvm-cov for coverage. Install it:

cargo install cargo-llvm-cov

The project maintains a coverage baseline in .coverage-baseline.jsonl. The pre-push hook checks that coverage doesn't regress beyond a 5% tolerance.

Quick Reference

TaskCommand
Check compilescargo check
Buildcargo build
Run locallycargo run -- <command>
All testscargo test-all
Format codecargo fmt
Lintcargo clippy
Coverage report./scripts/test-summary.sh --coverage