|
| 1 | +# Contributing to GitHub Artist |
| 2 | + |
| 3 | +Thank you for your interest in contributing to GitHub Artist! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## 🚀 Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Python 3.12 or higher |
| 10 | +- Git |
| 11 | +- UV package manager (recommended) or pip |
| 12 | + |
| 13 | +### Setting Up Development Environment |
| 14 | + |
| 15 | +1. Fork and clone the repository: |
| 16 | +```bash |
| 17 | +git clone https://github.com/your-username/github-artist.git |
| 18 | +cd github-artist |
| 19 | +``` |
| 20 | + |
| 21 | +2. Install UV (if not already installed): |
| 22 | +```bash |
| 23 | +pip install uv |
| 24 | +``` |
| 25 | + |
| 26 | +3. Install the package in development mode: |
| 27 | +```bash |
| 28 | +uv pip install -e . |
| 29 | +``` |
| 30 | + |
| 31 | +4. Install development dependencies: |
| 32 | +```bash |
| 33 | +pip install pytest |
| 34 | +``` |
| 35 | + |
| 36 | +## 🧪 Running Tests |
| 37 | + |
| 38 | +Run the test suite to ensure everything works: |
| 39 | + |
| 40 | +```bash |
| 41 | +# Run all tests |
| 42 | +pytest tests/ |
| 43 | + |
| 44 | +# Run with verbose output |
| 45 | +pytest tests/ -v |
| 46 | + |
| 47 | +# Run specific test file |
| 48 | +pytest tests/test_characters.py |
| 49 | + |
| 50 | +# Run with coverage |
| 51 | +pytest tests/ --cov=github_artist |
| 52 | +``` |
| 53 | + |
| 54 | +## 📝 Code Style |
| 55 | + |
| 56 | +- Follow PEP 8 style guidelines |
| 57 | +- Use type hints where appropriate |
| 58 | +- Add docstrings to functions and classes |
| 59 | +- Keep lines under 100 characters when practical |
| 60 | +- Use meaningful variable and function names |
| 61 | + |
| 62 | +### Example Function Style |
| 63 | + |
| 64 | +```python |
| 65 | +def calculate_something(value: int, option: str = "default") -> dict: |
| 66 | + """ |
| 67 | + Brief description of what the function does. |
| 68 | + |
| 69 | + Args: |
| 70 | + value: Description of the value parameter |
| 71 | + option: Description of the option parameter (default: "default") |
| 72 | + |
| 73 | + Returns: |
| 74 | + Dictionary with the results |
| 75 | + |
| 76 | + Raises: |
| 77 | + ValueError: When value is negative |
| 78 | + """ |
| 79 | + if value < 0: |
| 80 | + raise ValueError("Value must be non-negative") |
| 81 | + |
| 82 | + return {"result": value} |
| 83 | +``` |
| 84 | + |
| 85 | +## 🎨 Adding New Characters |
| 86 | + |
| 87 | +To add support for new characters: |
| 88 | + |
| 89 | +1. Edit `github_artist/data/characters.py` |
| 90 | +2. Add your character matrix to the `CHAR_MATRICES` dictionary |
| 91 | +3. Ensure the matrix is exactly 7 rows tall |
| 92 | +4. Each cell should be 0 (empty) or 1 (filled) |
| 93 | + |
| 94 | +Example: |
| 95 | +```python |
| 96 | +"X": [ |
| 97 | + [1, 0, 0, 1], |
| 98 | + [1, 0, 0, 1], |
| 99 | + [0, 1, 1, 0], |
| 100 | + [0, 1, 1, 0], |
| 101 | + [0, 1, 1, 0], |
| 102 | + [1, 0, 0, 1], |
| 103 | + [1, 0, 0, 1], |
| 104 | +], |
| 105 | +``` |
| 106 | + |
| 107 | +3. Test your character: |
| 108 | +```bash |
| 109 | +python -m github_artist.cli preview "X" |
| 110 | +``` |
| 111 | + |
| 112 | +4. Add tests in `tests/test_characters.py` if appropriate |
| 113 | + |
| 114 | +## 🐛 Bug Reports |
| 115 | + |
| 116 | +When reporting bugs, please include: |
| 117 | + |
| 118 | +- Python version |
| 119 | +- Operating system |
| 120 | +- Steps to reproduce the bug |
| 121 | +- Expected behavior |
| 122 | +- Actual behavior |
| 123 | +- Error messages (if any) |
| 124 | + |
| 125 | +Use the GitHub issue template and label the issue as "bug". |
| 126 | + |
| 127 | +## 💡 Feature Requests |
| 128 | + |
| 129 | +For feature requests: |
| 130 | + |
| 131 | +- Check if the feature has already been requested |
| 132 | +- Clearly describe the feature and its use case |
| 133 | +- Explain why it would be valuable |
| 134 | +- Consider providing examples or mockups |
| 135 | + |
| 136 | +Label the issue as "enhancement". |
| 137 | + |
| 138 | +## 🔧 Pull Request Process |
| 139 | + |
| 140 | +1. **Create a branch**: Use a descriptive name |
| 141 | + ```bash |
| 142 | + git checkout -b feature/my-new-feature |
| 143 | + # or |
| 144 | + git checkout -b fix/bug-description |
| 145 | + ``` |
| 146 | + |
| 147 | +2. **Make your changes**: |
| 148 | + - Write clean, documented code |
| 149 | + - Add tests for new functionality |
| 150 | + - Update documentation as needed |
| 151 | + |
| 152 | +3. **Test your changes**: |
| 153 | + ```bash |
| 154 | + pytest tests/ |
| 155 | + ``` |
| 156 | + |
| 157 | +4. **Commit your changes**: |
| 158 | + ```bash |
| 159 | + git add . |
| 160 | + git commit -m "feat: add new feature description" |
| 161 | + # or |
| 162 | + git commit -m "fix: bug description" |
| 163 | + ``` |
| 164 | + |
| 165 | + Use conventional commit messages: |
| 166 | + - `feat:` for new features |
| 167 | + - `fix:` for bug fixes |
| 168 | + - `docs:` for documentation changes |
| 169 | + - `test:` for adding tests |
| 170 | + - `refactor:` for code refactoring |
| 171 | + |
| 172 | +5. **Push to your fork**: |
| 173 | + ```bash |
| 174 | + git push origin feature/my-new-feature |
| 175 | + ``` |
| 176 | + |
| 177 | +6. **Open a Pull Request**: |
| 178 | + - Provide a clear description of the changes |
| 179 | + - Reference any related issues |
| 180 | + - Ensure all tests pass |
| 181 | + - Wait for review |
| 182 | + |
| 183 | +## 📚 Documentation |
| 184 | + |
| 185 | +When adding features: |
| 186 | + |
| 187 | +- Update the README.md if the feature is user-facing |
| 188 | +- Add docstrings to new functions and classes |
| 189 | +- Update examples if behavior changes |
| 190 | +- Consider adding usage examples |
| 191 | + |
| 192 | +## 🎯 Areas for Contribution |
| 193 | + |
| 194 | +Here are some areas where contributions are especially welcome: |
| 195 | + |
| 196 | +### High Priority |
| 197 | +- [ ] Additional character designs |
| 198 | +- [ ] Improved character matrices for better visibility |
| 199 | +- [ ] More emoji support |
| 200 | +- [ ] Better error messages |
| 201 | + |
| 202 | +### Medium Priority |
| 203 | +- [ ] Performance optimizations |
| 204 | +- [ ] Additional output formats |
| 205 | +- [ ] Template system for common patterns |
| 206 | +- [ ] Interactive mode improvements |
| 207 | + |
| 208 | +### Low Priority |
| 209 | +- [ ] Web interface |
| 210 | +- [ ] CI/CD improvements |
| 211 | +- [ ] Additional documentation |
| 212 | +- [ ] More examples |
| 213 | + |
| 214 | +## 🤝 Code of Conduct |
| 215 | + |
| 216 | +### Our Standards |
| 217 | + |
| 218 | +- Be respectful and inclusive |
| 219 | +- Welcome newcomers |
| 220 | +- Accept constructive criticism |
| 221 | +- Focus on what's best for the community |
| 222 | +- Show empathy towards others |
| 223 | + |
| 224 | +### Unacceptable Behavior |
| 225 | + |
| 226 | +- Harassment or discriminatory language |
| 227 | +- Personal attacks |
| 228 | +- Trolling or insulting comments |
| 229 | +- Publishing others' private information |
| 230 | +- Other unethical or unprofessional conduct |
| 231 | + |
| 232 | +## 📞 Getting Help |
| 233 | + |
| 234 | +- Open an issue for bugs or features |
| 235 | +- Join discussions in existing issues |
| 236 | +- Reach out to maintainers for questions |
| 237 | + |
| 238 | +## 🏆 Recognition |
| 239 | + |
| 240 | +Contributors will be: |
| 241 | +- Listed in the project's contributors |
| 242 | +- Mentioned in release notes for significant contributions |
| 243 | +- Credited in the README for major features |
| 244 | + |
| 245 | +## 📄 License |
| 246 | + |
| 247 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
| 248 | + |
| 249 | +--- |
| 250 | + |
| 251 | +Thank you for contributing to GitHub Artist! Your efforts help make this project better for everyone. 🎨✨ |
0 commit comments