|
| 1 | +""" |
| 2 | +CONTRIBUTING Guide for deep-diff |
| 3 | +================================ |
| 4 | + |
| 5 | +Thank you for considering contributing to deep-diff! This document provides |
| 6 | +guidelines and instructions for contributing to the project. |
| 7 | + |
| 8 | +## Getting Started |
| 9 | + |
| 10 | +1. **Fork the repository** on GitHub |
| 11 | +2. **Clone your fork** locally: |
| 12 | + ```bash |
| 13 | + git clone https://github.com/YOUR_USERNAME/diff.git |
| 14 | + cd diff |
| 15 | + ``` |
| 16 | +3. **Create a virtual environment**: |
| 17 | + ```bash |
| 18 | + python -m venv venv |
| 19 | + source venv/bin/activate # On Windows: venv\Scripts\activate |
| 20 | + ``` |
| 21 | +4. **Install development dependencies**: |
| 22 | + ```bash |
| 23 | + pip install -e ".[dev]" |
| 24 | + ``` |
| 25 | + |
| 26 | +## Development Workflow |
| 27 | + |
| 28 | +### Making Changes |
| 29 | + |
| 30 | +1. **Create a feature branch**: |
| 31 | + ```bash |
| 32 | + git checkout -b feature/your-feature-name |
| 33 | + ``` |
| 34 | +2. **Make your changes** to the code |
| 35 | +3. **Write or update tests** for your changes |
| 36 | +4. **Run tests locally**: |
| 37 | + ```bash |
| 38 | + pytest |
| 39 | + ``` |
| 40 | +5. **Format and lint your code**: |
| 41 | + ```bash |
| 42 | + black deep_diff tests |
| 43 | + ruff check --fix deep_diff tests |
| 44 | + mypy deep_diff |
| 45 | + ``` |
| 46 | + |
| 47 | +### Testing |
| 48 | + |
| 49 | +- All new features should include tests |
| 50 | +- Tests should be added to `tests/test_deep_diff.py` |
| 51 | +- Aim for >90% code coverage |
| 52 | +- Run tests with coverage: |
| 53 | + ```bash |
| 54 | + pytest --cov=deep_diff --cov-report=html |
| 55 | + ``` |
| 56 | + |
| 57 | +### Code Style |
| 58 | + |
| 59 | +- **Formatting**: Use `black` (line length: 100) |
| 60 | +- **Linting**: Use `ruff` |
| 61 | +- **Type hints**: Add type hints to all public functions |
| 62 | +- **Docstrings**: Use Google-style docstrings |
| 63 | + |
| 64 | +### Commit Messages |
| 65 | + |
| 66 | +- Use clear, descriptive commit messages |
| 67 | +- Start with a verb (Add, Fix, Update, etc.) |
| 68 | +- Reference issues when applicable: "Fix #123" |
| 69 | +- Example: "Add type hints to diff function" |
| 70 | + |
| 71 | +### Pull Request Process |
| 72 | + |
| 73 | +1. **Push to your fork**: |
| 74 | + ```bash |
| 75 | + git push origin feature/your-feature-name |
| 76 | + ``` |
| 77 | +2. **Create a Pull Request** on GitHub |
| 78 | +3. **Write a clear PR description**: |
| 79 | + - What changes you made |
| 80 | + - Why you made them |
| 81 | + - Any related issues |
| 82 | +4. **Ensure CI passes** (tests, linting, type checking) |
| 83 | +5. **Request review** from maintainers |
| 84 | + |
| 85 | +## Areas for Contribution |
| 86 | + |
| 87 | +- 🐛 **Bug fixes**: Report and fix issues |
| 88 | +- ✨ **Features**: Suggest and implement new functionality |
| 89 | +- 📚 **Documentation**: Improve documentation and examples |
| 90 | +- 🧪 **Tests**: Add test cases for edge cases |
| 91 | +- 🚀 **Performance**: Optimize performance-critical code |
| 92 | + |
| 93 | +## Reporting Issues |
| 94 | + |
| 95 | +- Use GitHub Issues for bug reports |
| 96 | +- Include: |
| 97 | + - Clear description of the issue |
| 98 | + - Steps to reproduce |
| 99 | + - Expected vs actual behavior |
| 100 | + - Python version and OS |
| 101 | + - Minimal code example |
| 102 | + |
| 103 | +## Questions? |
| 104 | + |
| 105 | +- Open an issue for discussion |
| 106 | +- Check existing issues and PRs first |
| 107 | +- Be respectful and constructive |
| 108 | + |
| 109 | +## Code of Conduct |
| 110 | + |
| 111 | +- Be respectful to all contributors |
| 112 | +- Follow PEP 8 style guidelines |
| 113 | +- Test your changes thoroughly |
| 114 | +- Write clear, understandable code |
| 115 | + |
| 116 | +## License |
| 117 | + |
| 118 | +By contributing, you agree that your contributions will be licensed under |
| 119 | +the same BSD 3-Clause License as the project. |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +Thanks for contributing to deep-diff! 🎉 |
| 124 | +""" |
0 commit comments