Contributing¶
This guide covers how to contribute to pfig. For the short OSS onboarding path, see the CONTRIBUTING.md file in the repository root.
Code Style¶
- Follow PEP 8
- Use type hints for all public APIs
- Add docstrings for public functions and classes
- Keep lines under 100 characters when reasonable
Code formatting is enforced via pre-commit hooks using:
- Ruff - Code formatter and import sorter
- Pyright - Type checker for the
pfigpackage
Pre-commit Setup¶
Pre-commit hooks automatically format and check your code before commits. Set them up:
-
Install pre-commit (if not already installed):
-
Install the hooks:
-
Test the hooks (optional):
The hooks will automatically run on git commit. To manually run them:
CI runs the same pre-commit hook set, including pyright.
The pyright hook is a local language: system hook. If pre-commit run --all-files
reports Executable 'pyright' not found, activate the virtual environment where you
installed .[dev,remote,lsp] or otherwise ensure pyright is available on PATH.
Commit Message Format¶
We use Conventional Commits:
Common types:
build- Changes to build system or dependenciesci- Changes to CI configurationchore- Maintenance tasksdocs- Documentation changesfeat- New featuresfix- Bug fixesperf- Performance improvementsrefactor- Code refactoringrevert- Revert previous commitstyle- Code style changes (formatting, etc.)test- Test additions or changes
Examples:
feat: add syntax highlighting for provider references
fix: correct pattern matching order
docs: update contributing guidelines
test: add tarball extraction safety regression tests
Breaking changes use feat!: or fix!: and should include a BREAKING CHANGE: footer when the impact is not obvious from the subject line.
Releases¶
Version numbers follow Semantic Versioning. Maintainers cut releases from tagged commits on main and publish release notes in CHANGELOG.md.
Pull Request Process¶
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Write tests for your changes
- Ensure all tests pass:
pytest - Update documentation if needed
- Submit pull request with clear description
Areas for Contribution¶
- Performance optimizations in execution engine
- Better error messages and diagnostics
- IDE integrations - VS Code extension
- Additional CLI features per specification
- Documentation improvements
- Example configurations for different ML frameworks
Further Reading¶
- Development Setup - Setting up your environment
- Development Workflow - How to work on pfig
- Architecture - Understanding pfig internals
- Specification - Complete language specification