Pre-commit hook for validating K9 configuration files.
K9 is a Nickel-based configuration contract format used for deployment
validation and policy enforcement. This hook validates .k9 and .k9.ncl
files on commit.
-
K9! magic number — First non-empty line must be exactly
K9! -
SPDX header —
SPDX-License-Identifierin the first 10 lines -
Pedigree block —
pedigree = { … }withnameandversionfields -
Security level —
leash/security_levelmust bekennel,yard, orhunt -
Hunt-level signature — Hunt files must include
signatureorsignature_required
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/hyperpolymath/k9-pre-commit
rev: v1.0.0
hooks:
- id: validate-k9Then install:
pre-commit installYou can also run the hook script directly:
./hooks/validate-k9.sh path/to/file.k9.ncl [more-files.k9 ...]| Level | Trust | Requirements |
|---|---|---|
|
Data-only |
No signature required |
|
Validated |
Nickel contracts enforced |
|
Full access |
Signature required |
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
SPDX-License-Identifier: PMPL-1.0-or-later
See LICENSE for details.