Thank you for your interest in contributing to AIGrok! This document provides guidelines and instructions for contributing to the project.
- Python 3.9 or higher
- pip (Python package installer)
- git
- virtualenv or conda (recommended)
-
Clone the repository:
git clone https://github.com/yourusername/aigrok.git cd aigrok
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -e ".[dev]"
-
Install pre-commit hooks:
pre-commit install
We follow strict PEP 8 guidelines with these additional requirements:
- Use type hints for all function parameters and return values
- Write docstrings for all public functions, classes, and methods
- Keep functions focused and single-purpose
- Maximum line length: 88 characters (Black formatter)
- Use descriptive variable names
Example:
def process_document(
file_path: str,
prompt: Optional[str] = None,
*,
model: str = "default"
) -> ProcessingResult:
"""Process a document using the specified model.
Args:
file_path: Path to the document file
prompt: Optional processing prompt
model: Model name to use for processing
Returns:
ProcessingResult containing the processed output
Raises:
ValueError: If file_path is invalid
ProcessingError: If processing fails
"""
# Implementation
-
Create a new branch for your feature/fix:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write tests for new functionality
- Update documentation as needed
- Follow code style guidelines
-
Commit your changes:
git add . git commit -m "feat: add new feature"
Commit message format:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- test: Test additions/modifications
- refactor: Code refactoring
- style: Code style changes
- chore: Maintenance tasks
-
Push your branch and create a pull request:
git push origin feature/your-feature-name
-
Write tests for all new functionality
-
Maintain or improve code coverage
-
Run the full test suite before submitting PR:
python -m pytest tests/
- Update relevant documentation for any changes
- Include docstrings for new functions/classes
- Add examples for new features
- Update README.md if needed
-
Before Submitting
- Ensure all tests pass
- Run code formatting:
black .
- Run type checking:
mypy .
- Run linting:
ruff .
- Update documentation
-
PR Template
## Description Brief description of changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Documentation update - [ ] Refactoring ## Testing - [ ] Added new tests - [ ] Updated existing tests - [ ] All tests passing ## Documentation - [ ] Updated relevant documentation - [ ] Added/updated docstrings - [ ] Updated README if needed
-
Review Process
- Address reviewer comments
- Keep PR focused and single-purpose
- Maintain clear communication
-
Version Bumping
- Follow semantic versioning
- Update version in setup.py
- Update CHANGELOG.md
-
Release Checklist
- All tests passing
- Documentation updated
- CHANGELOG.md updated
- Version bumped
- Release notes prepared
-
Release Steps
# Update version bump2version patch # or minor, or major # Create release branch git checkout -b release/v1.0.0 # Create release commit git commit -am "chore: release v1.0.0" # Tag release git tag -a v1.0.0 -m "Release v1.0.0" # Push release git push origin release/v1.0.0 --tags
- Open an issue for bugs or feature requests
- Join our community discussions
- Check existing documentation and issues
- Contact maintainers if needed
Please note that AIGrok has a Code of Conduct. By participating in this project, you agree to abide by its terms.
By contributing to AIGrok, you agree that your contributions will be licensed under its MIT license.