Contributing to proto2pydantic
March 22, 2026 ยท View on GitHub
Thank you for your interest in contributing!
Development Setup
-
Prerequisites: Nix (recommended) or Go 1.25+, buf, protoc
-
Enter dev shell (pick one):
# Option A: direnv (auto-activates when you cd into the repo) direnv allow # Option B: manual nix developBoth install Go 1.25, buf, protoc, gh, golangci-lint, and pre-commit automatically.
-
Pre-commit hooks are installed automatically by the shell. They run
gofmt,go vet, andgo mod tidyon every commit. To run manually:pre-commit run --all-files -
Build:
go build -o protoc-gen-proto2pydantic . -
Test:
go test ./... -v -
Regenerate golden file (after changing generator logic):
cd testdata/proto && buf generate
Pull Request Process
- Fork the repo and create a feature branch
- Make your changes
- Run
go test ./...andgo vet ./... - Ensure
gofmtis applied (pre-commit handles this automatically) - Update the golden file if generator output changes
- Open a PR against
main
Commit Messages
We use Conventional Commits:
feat:new featuresfix:bug fixeschore:maintenancedocs:documentationci:CI/CD changesdeps:dependency updates
Signed Commits
All commits to main must be signed. Set up Git commit signing:
# SSH signing (recommended)
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
# Or GPG signing
git config --global commit.gpgsign true
git config --global user.signingkey YOUR_GPG_KEY_ID
Make sure the signing key is added to your GitHub account SSH keys (type: "Signing Key").
Code of Conduct
Be respectful and constructive. We follow the Contributor Covenant.
License
By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.