Thank you for your interest in contributing to LocalMod! This document provides guidelines for contributing.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/localmod.git cd localmod - Install development dependencies:
pip install -e ".[all]"
# Run all tests
make test
# Run fast tests only (skip ML model downloads)
make test-fast
# Run specific test file
pytest tests/test_pii.py -vWe use:
flake8for lintingmypyfor type checkingblackfor formatting (optional)
# Check code style
make lint
# Format code
make formatpre-commit installfeature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updates
Use clear, descriptive commit messages:
feat: Add support for custom PII patterns
- Added PIIDetector.add_pattern() method
- Updated documentation
- Added tests for custom patterns
Prefixes:
feat:- New featurefix:- Bug fixdocs:- Documentationtest:- Testsrefactor:- Code refactoring
- Create
src/localmod/classifiers/your_classifier.py:
from localmod.models.base import BaseClassifier, ClassificationResult, Severity
class YourClassifier(BaseClassifier):
name = "your_classifier"
version = "1.0.0"
def load(self) -> None:
# Load model/patterns
pass
def predict(self, text: str) -> ClassificationResult:
# Implement prediction logic
pass-
Register in
src/localmod/classifiers/__init__.py -
Add tests in
tests/test_classifiers/test_your_classifier.py -
Update documentation
- Ensure tests pass:
make test - Update documentation if needed
- Create a pull request with a clear description
- Wait for review
Open an issue for questions or discussions.