Pre-commit Hooks
Catch broken StructKit YAML before it lands, using the official structkit-pre-commit hook repository.
Setup
Add the hooks to your .pre-commit-config.yaml. Tagged releases are coming; until then pin main or a specific commit SHA.
repos:
- repo: https://github.com/httpdss/structkit-pre-commit
rev: main
hooks:
- id: structkit-validate
- id: structkit-lintpre-commit installAvailable hooks
structkit-validate
Validates StructKit configuration files against the StructKit schema.
structkit-lint
Lints StructKit configuration files for issues and inconsistencies.
Files matched
Both hooks match .structkit.yaml and the legacy .struct.yaml, along with the structure files below:
.structkit.yaml*.structkit.yaml.struct.yaml/*.struct.yaml(legacy names, still supported)structures/**/*.yamlstructures/**/*.yml
Where this fits
Pre-commit covers the local loop; the GitHub Actions cover CI: install with httpdss/structkit-setup@v0, then run the same validation (and drift detection) with httpdss/structkit-action@v0. Note that these hooks lint and validate configuration — they are unrelated to StructKit's own pre/post generation hooks.
Related
- GitHub Actions — Install with httpdss/structkit-setup@v0, then validate and detect drift with httpdss/structkit-action@v0.
- Schema Reference — YAML schema reference: keys, types, defaults, validation, and editor autocomplete.
- Installation — Install StructKit via pip, Homebrew, Docker, Linux packages, or from source.
- VS Code / Cursor Extension — Schema validation, custom schema generation, and autocomplete for *.structkit.yaml files.