Thank you for your interest in contributing to hfl! This document provides guidelines for contributions.
Be respectful, inclusive, and constructive in all interactions.
# Clone the repository
git clone https://github.com/ggalancs/hfl
cd hfl
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linter
ruff check src/ tests/
# Format code
ruff format src/ tests/- Fork the repository and create a feature branch from
main - Write tests for any new functionality
- Ensure all tests pass:
pytest - Ensure code passes linting:
ruff check src/ tests/ - Update documentation if needed
- Submit PR with a clear description of changes
- Follow PEP 8 (enforced by ruff)
- Maximum line length: 100 characters
- Use type hints where practical
- Write docstrings for public APIs
hfl is licensed under Apache-2.0, which imposes no such condition — but as a project norm we ask that contributions which modify the safeguard modules preserve their protective functionality:
- License Verification - Must still verify and display model licenses
- Provenance Tracking - Must still record conversion history
- AI Disclaimer - Must still attach disclaimers to AI outputs
- Privacy Protection - Must NOT persist tokens to disk
- Gating Respect - Must NOT bypass HuggingFace gating
hfl's own Apache-2.0 license does not relicense the models users download. Every model retains its own license (Llama, Gemma, OpenRAIL, CC-BY-NC, and so on). Contributions must not weaken hfl's ability to surface and record those licenses: keep displaying license information before download, keep storing it in the model metadata, and never bypass a model's usage restrictions or HuggingFace gating. Users are responsible for complying with each model's license, and hfl exists to make that information visible — not to hide it.
- All new features require tests
- Maintain coverage above 80%
- Use mocks for external API calls (HuggingFace Hub)
- Use pytest fixtures from
conftest.py
- Use the GitHub issue tracker
- Include Python version, OS, and hfl version
- Provide minimal reproduction steps
- Include relevant error messages
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
hfl keeps its dependency tree permissively licensed — no copyleft
(GPL/AGPL/LGPL). This is enforced automatically by the license-check.yml CI
workflow (pip-licenses --fail-on=GPL;AGPL;LGPL;…), so a copyleft dependency
fails the build. Before adding a dependency, check its license with
pip-licenses --format=table --with-urls.