Contributing
How to contribute to Ripperdoc
We welcome contributions to Ripperdoc! This guide will help you get started.
Getting Started
Prerequisites
- Python 3.10+
- Git
- A GitHub account
Fork and Clone
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ripperdoc.git
cd ripperdocDevelopment Setup
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install in development mode:
pip install -e ".[dev]"- Install pre-commit hooks:
pre-commit installDevelopment Workflow
Running Tests
pytestRun specific tests:
pytest tests/test_tools.py
pytest tests/test_hooks.py -k "test_pre_tool_use"Code Style
We use:
- Black for formatting
- Ruff for linting
- MyPy for type checking
Run all checks:
black .
ruff check .
mypy ripperdocMaking Changes
- Create a branch:
git checkout -b feature/my-feature- Make your changes
- Write tests for new functionality
- Run tests and linting
- Commit with a descriptive message:
git commit -m "feat: add new feature X"Contribution Types
Bug Fixes
- Check existing issues for the bug
- Create an issue if it doesn't exist
- Reference the issue in your PR
New Features
- Open an issue to discuss the feature
- Wait for feedback before implementing
- Follow the existing code patterns
Documentation
Documentation improvements are always welcome:
- Fix typos
- Improve explanations
- Add examples
- Translate documentation
New Tools
To add a new tool:
- Create
ripperdoc/tools/my_tool.py - Implement the
Toolinterface - Register in
ripperdoc/core/default_tools.py - Add tests in
tests/test_my_tool.py - Document in
docs/
Pull Request Process
- Update documentation if needed
- Add tests for new functionality
- Ensure all tests pass
- Update CHANGELOG.md
- Submit PR with clear description
PR Title Format
Use conventional commits:
feat:New featurefix:Bug fixdocs:Documentationtest:Testsrefactor:Code refactoringchore:Maintenance
PR Description Template
## Description
[What does this PR do?]
## Related Issues
Fixes #123
## Changes
- Change 1
- Change 2
## Testing
[How was this tested?]
## Checklist
- [ ] Tests added
- [ ] Documentation updated
- [ ] CHANGELOG updatedCode Guidelines
Python Style
- Follow PEP 8
- Use type hints
- Write docstrings for public functions
- Keep functions focused and small
Error Handling
- Use specific exception types
- Log errors appropriately
- Provide helpful error messages
Testing
- Write unit tests for new code
- Use pytest fixtures
- Mock external dependencies
- Aim for high coverage
Getting Help
- Open an issue for questions
- Join discussions on GitHub
- Check existing issues and PRs
License
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.