Thanks for your interest in contributing! This guide covers the basics.
- Go 1.26+
- No platform-specific dependencies — the library is pure Go and runs anywhere Go does.
git clone https://github.com/floatpane/go-patchapply.git
cd go-patchapply
go mod tidygo build ./...
go test ./...gofmt -l .
go vet ./...
golangci-lint runCreate a branch from master using one of these prefixes:
feature/— new functionalityfix/— bug fixesdocs/— documentation changesrefactor/— code restructuring without behavior changes
We use Conventional Commits:
type(scope): short description
Common types: feat, fix, docs, test, ci, chore.
Examples:
feat(apply): tolerate hunk offset when locating context
fix(fs): reject absolute paths in DirFS
docs: document transactional two-phase apply
gofmt -l .is clean.go vet ./...is clean.go test ./...passes (including the race detector:go test -race ./...).- Keep PRs focused — one logical change per PR.
- Write a clear PR description: what changed and why.
Open an issue using the bug report template. Include:
- A minimal reproducer (the diff and the file it's applied to, an
Apply/ApplyToBytessnippet, or a failing test) - Expected vs. actual behavior
- Go version, OS
Open an issue using the feature request template. Describe the problem and your proposed solution.
We welcome contributions that use AI-assisted tools (Copilot, Claude, ChatGPT, etc.). Contributors are fully responsible for any code they submit, regardless of how it was written.
What we expect:
- Understand what you submit. You should be able to explain every line of your PR.
- Review AI output carefully. AI tools produce plausible-looking code that is sometimes subtly wrong, insecure, or off-pattern. Verify before committing.
- No AI-generated issues, reviews, or comments. Discussions should be genuine human communication.
- No AI-generated tests that don't actually test anything. Tests must validate behavior, not just exist for coverage.
- Attribute when appropriate. A brief mention in the PR description is appreciated but not required.
What we won't accept:
- Bulk PRs of AI-generated refactors or "improvements" that weren't requested.
- Code that introduces hallucinated dependencies, APIs, or patterns.
- Contributions where the author clearly doesn't understand the changes.
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold a welcoming and respectful environment.