1
Contributing
Gabriel Kaszewski edited this page 2026-05-29 02:15:57 +00:00

Contributing


Dev setup

git clone https://git.gabrielkaszewski.dev/GKaszewski/k-ap.git
cd k-ap
cargo build

No special tooling required beyond a recent stable Rust (edition 2024).


Make targets

make check    # rustfmt --check + clippy -D warnings + tests
make fmt      # apply rustfmt
make fix      # fmt + clippy --fix (auto-fixable lints)

Always run make check before pushing. CI runs the same checks.


Before opening a PR

  • make check passes with zero warnings
  • New behavior has test coverage — tests live in src/tests/
  • No unrelated refactoring mixed into the PR
  • Commit messages follow imperative style: feat: add X, fix: Y, refactor: Z

Project structure

src/
├── activities/    # One file per AP activity type (Follow, Create, Announce, ...)
├── repository/    # Trait definitions (ActivityRepository, FollowRepository, ...)
├── service/       # Service methods (broadcast, follow management, delivery, backfill)
├── tests/         # Unit and integration tests
├── content.rs     # ApContentReader, ApObjectHandler traits
├── user.rs        # ApUserRepository, ApUser, ApVisibility, LookedUpActor
├── data.rs        # FederationData, EventPublisher, FederationEvent
└── lib.rs         # Public API surface — all re-exports