Contributing¶
Thank you for your interest in contributing to Open Reviewer!
Getting Started¶
Clone the Repository¶
Set Up Development Environment¶
Run Tests¶
Development Workflow¶
1. Create a Branch¶
2. Make Changes¶
- Write code
- Add tests
- Update documentation
3. Run Checks¶
# Run tests
uv run pytest -v
# Type checking (if configured)
uv run mypy review_eval
# Linting (if configured)
uv run ruff check .
4. Submit a Pull Request¶
- Push your branch
- Open a PR against
main - Fill out the PR template
- Wait for review
Code Guidelines¶
Python Style¶
- Use type hints on all public functions
- Follow PEP 8
- Maximum line length: 100 characters
- Use docstrings (Google style)
def evaluate(self, test_case: GoldenTestCase) -> ReviewResult:
"""Evaluate a test case and return the result.
Args:
test_case: The test case to evaluate.
Returns:
ReviewResult with matched and missed issues.
"""
Documentation¶
- Update docs when adding features
- Include code examples
- Use clear, concise language
Tests¶
- Add tests for new functionality
- Maintain test coverage
- Use descriptive test names
def test_multi_model_returns_consensus_issues():
"""MultiModelEvaluator should return consensus issues."""
...
Types of Contributions¶
Bug Fixes¶
- Check existing issues first
- Create an issue if not exists
- Reference the issue in your PR
New Features¶
- Open an issue to discuss the feature
- Get feedback before implementing
- Document the feature thoroughly
Documentation¶
- Fix typos and errors
- Improve explanations
- Add examples
Test Cases¶
Add new golden test cases:
GoldenTestCase(
id="your-pattern-name",
file_path="fixtures/your_pattern.py",
code="...",
expected_issues=["keyword1", "keyword2"],
category="python",
)
Project Structure¶
open-reviewer/
├── .github/
│ ├── workflows/ # GitHub Actions
│ ├── actions/ # Custom actions
│ └── scripts/ # Helper scripts
├── docs/ # Documentation (MkDocs)
├── review_eval/ # Main Python package
│ ├── review_eval/
│ │ ├── semantic/ # Semantic analysis
│ │ └── ...
│ └── tests/
└── mkdocs.yml
Questions?¶
- Open an issue for questions
- Check existing issues and discussions
- Read the documentation
License¶
By contributing, you agree that your contributions will be licensed under the same license as the project.