Thank you for contributing to QuantMind! This guide provides essential information for developers.
- Fork and clone the repository
- Set up environment:
uv venv && source .venv/bin/activate uv pip install -e .
- Install pre-commit hooks:
./scripts/pre-commit-setup.sh
We use pre-commit hooks to ensure code quality and consistency. These hooks automatically format code, run linting, and perform other quality checks before each commit.
Install pre-commit hooks:
# Automated setup (recommended)
./scripts/pre-commit-setup.sh
# Or manual setup
pip install pre-commit
pre-commit install
pre-commit install --hook-type pre-pushWhat the hooks do:
-
On every commit:
- Code formatting with
ruff format(80-char line length) - Linting with
ruff check --fix(auto-fixes issues) - File quality checks (trailing whitespace, EOF, YAML syntax)
- Safety checks (large files, merge conflicts)
- Code formatting with
-
On push to remote:
- Full unit test suite via
scripts/unittest.sh
- Full unit test suite via
Manual execution:
# Run formatting and linting
./scripts/lint.sh
# Run all pre-commit hooks on all files
pre-commit run --all-files
# Run specific tests
./scripts/unittest.sh tests/quantmind/sources/
./scripts/unittest.sh all # Run all testsTroubleshooting:
- If hooks fail, fix the issues and commit again
- To skip hooks temporarily (not recommended):
git commit --no-verify - Update hooks:
pre-commit autoupdate
- Location: All new code in
quantmind/module - Style: Google-style docstrings, 80-char line length
- Architecture: Abstract base classes + dependency injection
- Type Safety: Pydantic models + comprehensive type hints
- Unit tests: Required in
tests/quantmind/(mirror module structure) - Coverage: Test success and error cases
- Mocking: Mock external APIs and file systems
- Examples: Add to
examples/quantmind/for new features - Docstrings: Google-style format for all public methods
- Extend
BaseSource[ContentType]inquantmind/sources/ - Add config in
quantmind/config/sources.py - Include tests and usage example
- Extend
BaseParserinquantmind/parsers/ - Handle multiple content formats with error handling
- Extend
BaseTaggerinquantmind/tagger/ - Support rule-based and ML approaches
- Extend
BaseStorageinquantmind/storage/ - Implement indexing, querying, and concurrent access
- Create feature branch from
master - Follow conventional commits:
type(scope): description - Pre-commit hooks run automatically on commit/push
- Before submitting:
pre-commit run --all-files ./scripts/unittest.sh all
- Submit PR using our template
- Code in
quantmind/following architecture patterns - Unit tests with comprehensive coverage
- Usage example (for new features)
- All pre-commit hooks pass
- Conventional commit format
# Run specific tests
pytest tests/quantmind/sources/
pytest tests/quantmind/models/
# Test CLI functionality
quantmind extract "test query" --max-papers 5
quantmind config show
# Check code quality
./scripts/lint.sh- Check existing issues
- Review architecture patterns in existing code
- Look at
examples/for usage patterns - See
CLAUDE.mdfor detailed architecture
Thank you for contributing! 🚀