Thank you for considering contributing to deep-diff! This document provides guidelines and instructions for contributing to the project.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/diff.git cd diff - Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e ".[dev]"
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes to the code
- Write or update tests for your changes
- Run tests locally:
pytest
- Format and lint your code:
black deep_diff tests ruff check --fix deep_diff tests mypy deep_diff
- All new features should include tests
- Tests should be added to
tests/test_deep_diff.py - Aim for >90% code coverage
- Run tests with coverage:
pytest --cov=deep_diff --cov-report=html
- Formatting: Use
black(line length: 100) - Linting: Use
ruff - Type hints: Add type hints to all public functions
- Docstrings: Use Google-style docstrings
- Use clear, descriptive commit messages
- Start with a verb (Add, Fix, Update, etc.)
- Reference issues when applicable: "Fix #123"
- Example: "Add type hints to diff function"
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request on GitHub
- Write a clear PR description:
- What changes you made
- Why you made them
- Any related issues
- Ensure CI passes (tests, linting, type checking)
- Request review from maintainers
- 🐛 Bug fixes: Report and fix issues
- ✨ Features: Suggest and implement new functionality
- 📚 Documentation: Improve documentation and examples
- 🧪 Tests: Add test cases for edge cases
- 🚀 Performance: Optimize performance-critical code
- Use GitHub Issues for bug reports
- Include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS
- Minimal code example
- Open an issue for discussion
- Check existing issues and PRs first
- Be respectful and constructive
- Be respectful to all contributors
- Follow PEP 8 style guidelines
- Test your changes thoroughly
- Write clear, understandable code
By contributing, you agree that your contributions will be licensed under the same BSD 3-Clause License as the project.
Thanks for contributing to deep-diff! 🎉 """