- Python 3.12 or higher
- uv
- Git
-
Fork the Repository
# Fork via GitHub UI, then: git clone https://github.com/integrallis/mfcqi-python.git cd mfcqi
-
Create a Virtual Environment
# Using uv (recommended) uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies uv pip install -e ".[dev]"
-
Set Up Pre-commit Hooks
pre-commit install
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-descriptionWrite tested, meaningful contributions to the project.
Before submitting:
# Run all tests
uv run pytest
# Check coverage
uv run pytest --cov=mfcqi --cov-report=term-missing
# Type checking
uv run mypy --strict src/
# Linting
uv run ruff check src/
# Format code
uv run ruff format src/
# IMPORTANT: Check MFCQI score (must maintain or improve)
uv run mfcqi analyze src/mfcqi --skip-llm
# Current score: 0.753 - Your changes should maintain or improve this- Follow PEP 8
- Use type hints for all functions
- Maximum line length: 120 characters
- Use descriptive variable names
- Document all public APIs
-
All public functions must have docstrings
-
Use Google-style docstrings:
def calculate_metric(code: str, threshold: float = 0.5) -> float: """Calculate a quality metric from source code. Args: code: The source code to analyze. threshold: Quality threshold for normalization. Returns: A normalized metric value between 0.0 and 1.0. Raises: SyntaxError: If the code cannot be parsed. """
Follow the Conventional Commits specification:
feat: add new complexity metric
fix: correct normalization in pattern detection
docs: update API documentation
test: add integration tests for CLI
refactor: simplify metric calculation logic
perf: optimize AST traversal
chore: update dependencies
- Core modules: 100% coverage required
- New features: Must include comprehensive tests
- Bug fixes: Must include regression tests
tests/
├── unit/ # Unit tests for individual components
├── integration/ # Integration tests
├── property/ # Property-based tests (Hypothesis)
└── benchmarks/ # Performance benchmarks
- Ensure all tests pass
- Update documentation if needed
- Update CHANGELOG.md with your changes
- Create Pull Request with clear description
- Address review feedback promptly
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] All tests pass
- [ ] New tests added
- [ ] Coverage maintained at 100%
## Checklist
- [ ] Tests written for changes
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] MFCQI score maintained or improved (≥0.753)Include:
- Python version
- MFCQI version
- Minimal reproducible example
- Expected vs actual behavior
- Error messages/stack traces
Include:
- Use case description
- Proposed API/interface
- Example usage
- Why existing features don't suffice
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive criticism
- Assume good intentions
- Check existing issues first
- Use discussions for questions
- Join our Discord server (coming soon)
- Read the documentation thoroughly
- Research the metric thoroughly
- Submit a proposal in Markdown format
- Write comprehensive tests
- Implement extraction logic
- Add normalization function
- Integrate with MFCQI formula
- Update documentation
- Add benchmark tests
- Study existing provider implementations
- Implement provider interface
- Add configuration support
- Create integration tests
- Update CLI commands
- Document usage and costs
Feel free to:
- Open an issue for discussion
- Reach out to maintainers
- Check FAQ in documentation
Remember: Quality over Quantity. Better to contribute one well-tested, well-documented feature than multiple incomplete ones.
Thank you for contributing to MFCQI.