Files

1.5 KiB

Agent instructions

Git Commit Style

  • Make small, focused commits while working
  • Commit changes incrementally to make history easier to follow
  • Write clear, concise commit messages describing what changed
  • Ask permission before commiting or merging to main branch
  • When applicable, write tests before implementation

Developer Commands

# Unit tests (fast, no database required)
cargo test --lib

# Integration tests (requires test DB - run setup first)
cargo run -- db setup --env test
cargo test --tests

# Single test file
cargo test --test config_test

# CLI commands
cargo run -- db setup --env <dev|test|prod>
cargo run -- db reset --env <dev|test|prod>
cargo run -- import <csv-file> --env <dev|test|prod>
cargo run -- generate <csv-file> <output-dir>

Config Loading

  • Files: config.tomlconfig.<env>.tomlconfig.example.toml (fallback)
  • Gitignored: config.toml, config.dev.toml, config.test.toml, config.prod.toml
  • DB names: rusty_petroleum_dev, rusty_petroleum_test, rusty_petroleum_prod

Architecture

  • Binary: src/main.rs, Library: src/lib.rs
  • Test entry: tests/common/test_db.rs creates fresh DB per test via cargo test --test
  • Run lib tests first to verify logic without DB dependency

Issue Management

  • Use Gitea REST API to close issues:
    curl -X PATCH https://gitea.rowanbrook.net/api/v1/repos/jakob/rusty-petroleum/issues/{issue_number} \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -d '{"state": "closed"}'