Skip to content

Development

Mark Keller edited this page Nov 11, 2025 · 1 revision

Development

Prerequisites

  • Rust (2021 edition)
  • SQLite
  • Diesel CLI (optional if you only run embedded migrations)

Build

cargo build

Test

cargo test
  • Tests should not launch editors or touch real data. When running the app locally (or in tests), isolate data and disable editor interactions:
WORKINGON_DATA_DIR="$(mktemp -d)" EDITOR="-" cargo run -- list

Running locally

WORKINGON_DATA_DIR="$(mktemp -d)" EDITOR="-" cargo run -- <subcommand>

Database and migrations

  • Uses SQLite via Diesel; migrations are embedded and run on startup.
  • Additive migrations are preferred; include both up.sql and down.sql.
  • To test migrations, run the binary once to apply pending migrations.

CLI guidelines

  • Subcommands live in src/cli.rs.
  • Business logic and DB ops live in src/lib.rs.
  • Preserve backward compatibility and provide helpful errors/nonzero exit codes.
  • Consider intuitive aliases (e.g., ls for list, rm for delete).

Contributing

  • Ensure all tests pass.
  • Update help text and docs when changing flags/behaviors.
  • Include tests for new features.
  • Small, coherent commits following conventional commits.

Clone this wiki locally