File size: 769 Bytes
a750766 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Scripts
## `validate_hf_readme.py`
Validates that `README.md` is properly formatted for Hugging Face Spaces.
### Usage
```bash
# Run manually
python3 scripts/validate_hf_readme.py
# Automatically runs on git commit (via pre-commit hook)
git commit -m "Update README"
```
### What it validates
- β
YAML frontmatter exists and is properly formatted
- β
Required fields for Docker SDK (`sdk`, `app_port`)
- β
Valid values for `sdk`, `colorFrom`, `colorTo`, `suggested_hardware`
- β
Warns about deprecated fields (e.g., `hardware` β `suggested_hardware`)
- β
Recommends including `emoji` and `title` fields
### Pre-commit hook
The script is automatically run as a git pre-commit hook. If validation fails, the commit is aborted with error messages.
|