Skip to content

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

  1. Ensure all tests pass
  2. Format code with Black
  3. Update documentation
  4. Review your changes

Pull Request Description

Include:

  • Description of changes
  • Related issues
  • Testing performed
  • Screenshots (if applicable)

Code Review

Review Process

  1. Code is reviewed by team members
  2. Address review comments
  3. Make requested changes
  4. Re-request review if needed

Review Criteria

  • Code quality and style
  • Test coverage
  • Documentation updates
  • Performance considerations
  • Security implications

Best Practices

  1. Small Commits: Make focused, small commits
  2. Clear Messages: Write clear commit messages
  3. Test First: Write tests before implementation
  4. Document: Update documentation
  5. Communicate: Discuss major changes before implementing

Next Steps


For contribution questions, contact the development team.