Contributing
This guide explains how to contribute to ReversePilot development.
Code Style
Black Formatting
The project uses Black for code formatting.
Format code:
black .
Pre-commit Hooks
Pre-commit hooks automatically format code:
pre-commit install
Development Workflow
1. Create Feature Branch
git checkout -b feature/your-feature-name
2. Make Changes
- Write code following style guidelines
- Add tests for new features
- Update documentation as needed
3. Run Tests
pytest
4. Format Code
black .
5. Commit Changes
git add .
git commit -m "Description of changes"
6. Push and Create Pull Request
git push origin feature/your-feature-name
Code Standards
Python Style
- Follow PEP 8
- Use Black for formatting
- Maximum line length: 88 characters (Black default)
Django Patterns
- Use Django best practices
- Follow Django naming conventions
- Use Django ORM efficiently
Documentation
- Add docstrings to functions and classes
- Update documentation for new features
- Include examples in documentation
Testing Requirements
Test Coverage
- New features must include tests
- Aim for high test coverage
- Tests should be clear and maintainable
Running Tests
pytest
pytest --cov
Pull Request Process
Before Submitting
- Ensure all tests pass
- Format code with Black
- Update documentation
- Review your changes
Pull Request Description
Include:
- Description of changes
- Related issues
- Testing performed
- Screenshots (if applicable)
Code Review
Review Process
- Code is reviewed by team members
- Address review comments
- Make requested changes
- Re-request review if needed
Review Criteria
- Code quality and style
- Test coverage
- Documentation updates
- Performance considerations
- Security implications
Best Practices
- Small Commits: Make focused, small commits
- Clear Messages: Write clear commit messages
- Test First: Write tests before implementation
- Document: Update documentation
- Communicate: Discuss major changes before implementing
Next Steps
- Setup Guide - Development setup
- Models Guide - Data models
- Services Guide - Service layer
For contribution questions, contact the development team.