Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to kage are recorded here. The format follows

## [Unreleased]

### Added

- `CONTRIBUTING.md` documents the development setup, test commands, and
expectations for focused pull requests.

### Fixed

- `--resume` picks an interrupted crawl back up instead of doing nothing ([#36](https://github.com/tamnd/kage/issues/36)).
Expand Down
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing to kage

Thanks for helping. kage is a small, opinionated tool: patches that stay focused
and come with tests land fastest.

## Development setup

You need a recent Go toolchain (the `go` version in `go.mod`; Go 1.21+ will
download it automatically) and, for browser tests, Chrome or Chromium.

```bash
git clone https://github.com/tamnd/kage
cd kage
make build # -> bin/kage
make test-short # unit tests, no Chrome
make test # full suite, including Chrome e2e when a browser is present
make vet
```

Point kage at a browser with `KAGE_CHROME` / `CHROME_BIN` or `--chrome` if it is
not on the default path.

## What makes a good PR

- **One concern per PR.** Fix install, or sanitize, or packing — not all three
unless they are inseparable.
- **Tests for the regression.** Prefer a small unit test over a full site clone.
Chrome-driven tests should skip under `-short` and when no browser is found.
- **Update `CHANGELOG.md`** under `[Unreleased]` when the change is user-visible.
- **Match the local style.** Packages are deep modules with package comments;
exported behaviour is described in prose, not only in names. Run `gofmt -s`.
- **No new dependencies** unless they remove more code than they add. Explain
why a new module belongs in kage and what local code it replaces.

## Suggested first contributions

Open issues are the best map. High-impact areas that have already bitten users:

- SPA / lazy-content wait strategies for sites that never finish loading.
- Windows CI for `-short` tests.

Please open an issue before large design changes so the approach can be agreed.

## Reporting bugs

Include the kage version (`kage version`), OS, the exact command, and a minimal
reproducing URL when possible. Logs from a failed page render are especially
useful.

## License

By contributing, you agree that your contributions are licensed under the MIT
License (see [LICENSE](LICENSE)).