Contributing to pretok
Thank you for your interest in contributing to pretok!
Development Setup
- Clone the repository:
- Install dependencies with uv:
- Install pre-commit hooks:
Code Quality
We use the following tools:
- ruff - Linting and formatting
- mypy - Type checking
- pytest - Testing
Running Checks
# Linting
uv run ruff check src/ tests/
# Formatting
uv run ruff format src/ tests/
# Type checking
uv run mypy src/
# Tests
uv run pytest
Pull Request Process
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Run all checks:
uv run ruff check && uv run mypy src/ && uv run pytest - Commit with conventional commits:
git commit -m "feat: add new feature" - Push and create a Pull Request
Commit Convention
We use Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changestest:- Test changeschore:- Maintenance tasksrefactor:- Code refactoring
Testing
- Write tests for new features
- Maintain >80% code coverage
- Use pytest fixtures for common setup
- Mark slow tests with
@pytest.mark.slow
Documentation
- Update docs for user-facing changes
- Include docstrings for public APIs
- Add examples where helpful