Thank you for your interest in contributing to wt! This document provides guidelines and instructions for contributing.
- Go 1.25 or later
- Git 2.20 or later
- goreleaser (optional, for release testing)
-
Fork the repository on GitHub
-
Clone your fork:
git clone git@github.com:YOUR_USERNAME/wt.git cd wt -
Build and install:
just install # Install to ~/go/bin -
Verify installation:
wt--version
-
Run tests:
just test
Use the justfile for common tasks:
just # Show all available targets
# Build & test
just build # Build to ./bin/
just test # Run all tests
just lint # Run go vet + golangci-lint
just build-all # Cross-platform build check
# Development
just dev # Build and show version + alias hint
# After making changes
just test && just lint && just build-allTwo-binary setup: Install the released version via brew install raisedadead/tap/wt, then alias the dev build:
alias wt-dev='/path/to/wt/main/bin/wt'
wt list # released version
wt-dev list # dev buildwt/
├── cmd/wt/
│ └── main.go # Entry point
├── internal/
│ ├── tui/ # Lazygit-style TUI (bubbletea)
│ │ ├── panels/ # Worktree list, detail, header, footer
│ │ └── overlays/ # Help, confirm, input, menu
│ ├── commands/ # CLI commands (Cobra, flag-only)
│ ├── config/ # TOML config, hierarchical merge
│ ├── git/ # Git operations with timeouts
│ ├── hooks/ # Hook execution with workflow support
│ │ └── bundled/ # Embedded hook scripts + helpers.sh
│ └── ui/ # Terminal styling, tables, JSON envelope
├── test/integration/ # Integration tests
├── justfile # Build, test, release targets
├── .goreleaser.yaml # Release configuration
└── go.mod
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes
-
Run tests, lint, and cross-platform check:
just test just lint just build-all # Catches platform-specific issues
-
Commit your changes following the conventions below
-
Push to your fork and open a pull request
This project uses Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, etc.) |
refactor |
Code refactoring without feature changes |
perf |
Performance improvements |
test |
Adding or updating tests |
build |
Build system or dependency changes |
ci |
CI/CD configuration changes |
chore |
Other changes that don't modify src or test files |
Examples:
feat: add support for custom branch templates
fix: handle empty repository URL in clone command
docs: update README with zoxide integration details
refactor: extract git operations into separate package
test: add tests for worktree creation
ci: add cross-platform build check-
Keep PRs focused - Each PR should address a single concern
-
Update documentation - If your change affects user-facing behavior
-
Add tests - New features should include tests
-
Cross-platform - Run
just build-allto verify -
Follow existing patterns - Match the code style of the codebase
## Summary
Brief description of changes.
## Changes
- Change 1
- Change 2
## Testing
How was this tested?
## Checklist
- [ ] Tests pass (`just test`)
- [ ] Lint passes (`just lint`)
- [ ] Cross-platform build (`just build-all`)
- [ ] Documentation updated (if applicable)just test # Run all tests
go test -v ./internal/git/... # Run specific package
go test -cover ./... # With coverage- Place test files alongside the code they test
- Use table-driven tests where appropriate
- Test both success and error cases
Example:
func TestSlugify(t *testing.T) {
tests := []struct {
name string
input string
expected string
}{
{"lowercase", "Hello World", "hello-world"},
{"special chars", "Fix: bug #42", "fix-bug-42"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := Slugify(tt.input)
if result != tt.expected {
t.Errorf("Slugify(%q) = %q, want %q", tt.input, result, tt.expected)
}
})
}
}Use build tags for platform-specific code:
//go:build unix
package hooks
// Unix-specific implementation//go:build windows
package hooks
// Windows-specific implementationAlways verify with just build-all before submitting.
Releases are automated via GitHub Actions. See RELEASING.md for details.
Quick reference:
just release-alpha # Create alpha release
just release VERSION=0.1.0 # Create stable releaseBe respectful and constructive. We're all here to build great software together.
If you have questions, feel free to open an issue for discussion.