# Contributing to httptap
Thanks for wanting to help. This is a small project, so the rules are
few.
## Before you open a PR
- Open an issue first if the change is more than a bug fix, so we can
agree on shape before you spend time writing it.
- One logical change per PR. If a refactor fell out of a fix, split it.
- Keep the diff small. Anything over ~400 lines will take longer to
review.
## Building
git clone https://mercemay.top/src/httptap.git
cd httptap
make bpf # compile the BPF object
make build # build the static Go binary
You need:
- Go 1.22 or newer
- `clang` 14+ with BPF target (`clang --target=bpf ...` must work)
- `bpftool` on the build host to regenerate vmlinux.h
Run `make setup` on Debian/Ubuntu to install these via apt.
## Testing
make test # unit tests, no BPF needed
make test-bpf # loads the BPF object, requires a Linux host with root
Most PRs only need `make test`. The BPF-load tests run in CI on the
main branch; they are flaky under nested virtualisation.
Target is >75% line coverage on `internal/`. `make cover` opens the
report.
## Commit style
- One-line subject in the imperative present tense, 50 chars or less.
- Prefix with the package or area: `parser: handle bare LF`,
`tui: wrap long URLs`, `tracer: cope with stripped symbols`.
- Body wraps at 72 chars and explains *why*. The diff shows *what*.
Signed-off-by trailers are welcome but not required. We do not require
a CLA.
## PR checklist
- [ ] `make test` passes locally.
- [ ] `make vet` passes.
- [ ] `make lint` (golangci-lint) passes.
- [ ] New behaviour has a test.
- [ ] `CHANGELOG.md` has an entry in `## [Unreleased]`.
- [ ] Public API changes are called out in the PR description.
## Code style
- Standard Go formatting (`gofmt` / `goimports`).
- No init() side effects in library packages.
- Prefer the standard library. Adding a dependency needs a one-line
justification in the PR body.
- BPF programs go in `internal/tracer/` with a matching Go file that
embeds the compiled object via `go:embed`.
## Filing a bug
Open an issue with:
- Kernel version (`uname -r`).
- Go version.
- The command you ran and the output you got.
- What you expected to happen.
For anything that might be a BPF verifier or kernel compatibility
issue, attach `httptap --verbose --dry-run` output.
## License
By contributing, you agree that your contribution will be licensed
under the project's MIT license.