Thank you for your interest in contributing to gh-review-conductor! This document provides guidelines and instructions for contributing.
- Go 1.21 or higher
- GitHub CLI (
gh) installed and authenticated - Git
- Fork and clone the repository:
git clone https://github.com/gh-tui-tools/gh-review-conductor.git
cd gh-review-conductor-
Install commit hooks:
The repository contains a file called
.pre-commit-config.yamlthat defines “commit hook” behavior to be run locally in your environment each time you commit a change to the sources. To enable that “commit hook” behavior, first follow the installation instructions at https://pre-commit.com/#install, and then run this:pre-commit install
-
Install dependencies:
make deps- Build the project:
make build- Run tests:
make testmake buildThis will create the gh-review-conductor binary in the project root.
To test the plugin locally without installing it:
./gh-review-conductor list
./gh-review-conductor applyOr install it as a local extension:
make install
gh review-conductor list# Run all tests
make test
# Run tests with coverage
make test-coverage# Format code
make fmt
# Run linter
make lint- Feature:
feature/description - Bug fix:
fix/description - Documentation:
docs/description
Follow conventional commits:
feat: add new featurefix: resolve bugdocs: update documentationtest: add testsrefactor: improve code structure
- Create a new branch for your changes
- Make your changes with clear, descriptive commits
- Add or update tests as needed
- Ensure all tests pass:
make test - Format your code:
make fmt - Push your branch and create a pull request
- Describe your changes in the PR description
- Wait for review and address any feedback
.
├── cmd/ # Command implementations
│ ├── root.go # Root command
│ ├── list.go # List command
│ └── apply.go # Apply command
├── pkg/ # Packages
│ ├── github/ # GitHub API client
│ ├── parser/ # Suggestion parser
│ └── applier/ # File applier
├── main.go # Entry point
├── go.mod # Go module file
├── Makefile # Build automation
└── README.md # Documentation
When adding new features:
- Discuss the feature in an issue first
- Update relevant documentation
- Add tests for new functionality
- Ensure backward compatibility
- Update the README if needed
- Write tests for all new functionality
- Aim for good test coverage
- Use table-driven tests where appropriate
- Test edge cases and error conditions
The project uses build tags to exclude interactive TUI code from coverage metrics.
Code in *_nocov.go files (with //go:build !coverage) contains untestable
interactive terminal code. The make test-coverage command uses -tags=coverage
to swap in stub implementations, giving accurate coverage for testable code.
Example test structure:
func TestFeature(t *testing.T) {
tests := []struct {
name string
input string
expected string
}{
// Test cases
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test logic
})
}
}When reporting issues:
- Use the issue tracker
- Provide a clear title and description
- Include steps to reproduce
- Specify your environment (OS, Go version, gh version)
- Include relevant logs or error messages
Feel free to open an issue for any questions or discussions about contributing.
By contributing, you agree that your contributions will be licensed under the MIT License.