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.

    .pre-commit-config.yamlyaml
    repos:
      - repo: https://github.com/httpdss/structkit-pre-commit
        rev: main
        hooks:
          - id: structkit-validate
          - id: structkit-lint
    Terminalbash
    pre-commit install

    Available 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/**/*.yaml
    • structures/**/*.yml

    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.