|
| 1 | +# Contributing to commit-msg |
| 2 | + |
| 3 | +Thank you for your interest in contributing to `commit-msg`! We welcome contributions from developers of all skill levels. 🎉 |
| 4 | + |
| 5 | +## 🎃 Hacktoberfest |
| 6 | + |
| 7 | +This project is participating in [Hacktoberfest](https://hacktoberfest.com)! We welcome quality contributions throughout October and beyond. |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +- [Code of Conduct](#code-of-conduct) |
| 12 | +- [How Can I Contribute?](#how-can-i-contribute) |
| 13 | +- [Getting Started](#getting-started) |
| 14 | +- [Development Setup](#development-setup) |
| 15 | +- [Pull Request Process](#pull-request-process) |
| 16 | +- [Coding Standards](#coding-standards) |
| 17 | +- [Issue Labels](#issue-labels) |
| 18 | + |
| 19 | +## Code of Conduct |
| 20 | + |
| 21 | +This project adheres to the Hacktoberfest values: |
| 22 | +- **Everyone is welcome** - We value diversity and inclusivity |
| 23 | +- **Quantity is fun, quality is key** - We prioritize meaningful contributions |
| 24 | +- **Short-term action, long-term impact** - Your contributions help build the future |
| 25 | + |
| 26 | +Please be respectful and constructive in all interactions. |
| 27 | + |
| 28 | +## How Can I Contribute? |
| 29 | + |
| 30 | +### 🐛 Reporting Bugs |
| 31 | + |
| 32 | +Before creating a bug report: |
| 33 | +- Check the [existing issues](https://github.com/dfanso/commit-msg/issues) to avoid duplicates |
| 34 | +- Collect information about the bug: |
| 35 | + - OS and version |
| 36 | + - Go version |
| 37 | + - Steps to reproduce |
| 38 | + - Expected vs actual behavior |
| 39 | + |
| 40 | +### 💡 Suggesting Enhancements |
| 41 | + |
| 42 | +Enhancement suggestions are welcome! Please: |
| 43 | +- Use a clear and descriptive title |
| 44 | +- Provide a detailed description of the proposed feature |
| 45 | +- Explain why this enhancement would be useful |
| 46 | + |
| 47 | +### 🔧 Good First Issues |
| 48 | + |
| 49 | +Look for issues labeled `good first issue` or `help wanted` - these are great for newcomers! |
| 50 | + |
| 51 | +### 📝 Documentation |
| 52 | + |
| 53 | +Improving documentation is always appreciated: |
| 54 | +- Fix typos or unclear instructions |
| 55 | +- Add examples |
| 56 | +- Improve README clarity |
| 57 | +- Translate documentation |
| 58 | + |
| 59 | +## Getting Started |
| 60 | + |
| 61 | +1. **Fork the repository** on GitHub |
| 62 | +2. **Clone your fork** locally: |
| 63 | + ```bash |
| 64 | + git clone https://github.com/YOUR-USERNAME/commit-msg.git |
| 65 | + cd commit-msg |
| 66 | + ``` |
| 67 | +3. **Create a branch** for your changes: |
| 68 | + ```bash |
| 69 | + git checkout -b feature/your-feature-name |
| 70 | + ``` |
| 71 | + |
| 72 | +## Development Setup |
| 73 | + |
| 74 | +### Prerequisites |
| 75 | + |
| 76 | +- Go 1.23.4 or higher |
| 77 | +- Git |
| 78 | +- API key for either: |
| 79 | + - Google Gemini (`GEMINI_API_KEY`) |
| 80 | + - Grok (`GROK_API_KEY`) |
| 81 | + |
| 82 | +### Environment Setup |
| 83 | + |
| 84 | +1. Set up your environment variables: |
| 85 | + ```bash |
| 86 | + export COMMIT_LLM=gemini # or "grok" |
| 87 | + export GEMINI_API_KEY=your-api-key-here |
| 88 | + # OR |
| 89 | + export GROK_API_KEY=your-api-key-here |
| 90 | + ``` |
| 91 | + |
| 92 | +2. Install dependencies: |
| 93 | + ```bash |
| 94 | + go mod download |
| 95 | + ``` |
| 96 | + |
| 97 | +3. Run the application: |
| 98 | + ```bash |
| 99 | + go run src/main.go . |
| 100 | + ``` |
| 101 | + |
| 102 | +4. Build the executable: |
| 103 | + ```bash |
| 104 | + go build -o commit.exe src/main.go |
| 105 | + ``` |
| 106 | + |
| 107 | +### Testing Your Changes |
| 108 | + |
| 109 | +Before submitting a PR: |
| 110 | +1. Test the application in a Git repository |
| 111 | +2. Verify both LLM providers work (if applicable) |
| 112 | +3. Check for any errors or warnings |
| 113 | +4. Test on your target platform |
| 114 | + |
| 115 | +## Pull Request Process |
| 116 | + |
| 117 | +1. **Update documentation** if needed (README.md, code comments) |
| 118 | +2. **Follow the coding standards** (see below) |
| 119 | +3. **Write clear commit messages** (ironic for this project!) |
| 120 | +4. **Fill out the PR template** completely |
| 121 | +5. **Link related issues** using keywords like "Fixes #123" |
| 122 | +6. **Wait for review** - maintainers will review within 1-2 days |
| 123 | + |
| 124 | +### PR Title Format |
| 125 | + |
| 126 | +Use conventional commit format: |
| 127 | +- `feat:` - New feature |
| 128 | +- `fix:` - Bug fix |
| 129 | +- `docs:` - Documentation changes |
| 130 | +- `refactor:` - Code refactoring |
| 131 | +- `test:` - Adding tests |
| 132 | +- `chore:` - Maintenance tasks |
| 133 | + |
| 134 | +Example: `feat: add support for Claude API` |
| 135 | + |
| 136 | +## Coding Standards |
| 137 | + |
| 138 | +### Go Code Style |
| 139 | + |
| 140 | +- Follow [Effective Go](https://golang.org/doc/effective_go.html) guidelines |
| 141 | +- Use `gofmt` to format your code |
| 142 | +- Add comments for exported functions |
| 143 | +- Keep functions small and focused |
| 144 | +- Handle errors appropriately |
| 145 | + |
| 146 | +### Code Example |
| 147 | + |
| 148 | +```go |
| 149 | +// GenerateMessage creates a commit message from git changes |
| 150 | +func GenerateMessage(changes string, apiKey string) (string, error) { |
| 151 | + if changes == "" { |
| 152 | + return "", fmt.Errorf("no changes provided") |
| 153 | + } |
| 154 | + |
| 155 | + // Implementation here |
| 156 | + return message, nil |
| 157 | +} |
| 158 | +``` |
| 159 | + |
| 160 | +## Issue Labels |
| 161 | + |
| 162 | +- `good first issue` - Good for newcomers |
| 163 | +- `help wanted` - Extra attention needed |
| 164 | +- `bug` - Something isn't working |
| 165 | +- `enhancement` - New feature request |
| 166 | +- `documentation` - Documentation improvements |
| 167 | +- `hacktoberfest` - Eligible for Hacktoberfest |
| 168 | +- `hacktoberfest-accepted` - Approved for Hacktoberfest |
| 169 | + |
| 170 | +## Questions? |
| 171 | + |
| 172 | +Feel free to: |
| 173 | +- Open an issue with the `question` label |
| 174 | +- Reach out to the maintainers |
| 175 | +- Check existing issues and PRs for similar questions |
| 176 | + |
| 177 | +## License |
| 178 | + |
| 179 | +By contributing, you agree that your contributions will be licensed under the same license as the project. |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +Thank you for contributing to commit-msg! 🚀 |
| 184 | + |
0 commit comments