Valqore DocsDocs
IntegrationsPre-commit Hook

Pre-commit Hook

Catch infrastructure issues before they leave your machine.

Pre-commit Hook

The Valqore pre-commit hook evaluates Kubernetes and IaC manifests locally before you commit.

Setup

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/valqore/valqore-engine
    rev: v1.0.0
    hooks:
      - id: valqore
        name: Valqore
        args: ["--fail-on", "block", "--score"]
        types_or: [yaml, json, hcl, tf]
pre-commit install

Options

FlagDefaultDescription
--fail-onblockVerdict level that fails the hook: block, warn, or info.
--scoreoffPrint overall Valqore score.
--fixoffAuto-apply fixes and stage the changes.

Example Output

$ git commit -m "deploy api-gateway"
 
Valqore.................................................................Failed
- hook id: valqore
- exit code: 1
 
  ╭──────────────────────────────────────────────╮
  │  BLOCK — 3 findings in 2 files               │
  ╰──────────────────────────────────────────────╯
 
  Score: 54 / 100
 
  k8s/api-gateway/deployment.yaml
    ✗ [critical] Container runs as root
    ✗ [high] No resource limits defined
 
  k8s/api-gateway/service.yaml
    ✗ [high] No network policy for namespace "api"
 
  Run with --fix to auto-resolve fixable issues.

Tips

  • Use --fail-on warn during early development, switch to --fail-on block once stable.
  • Combine with CI integration for defence in depth.
  • Run pre-commit run valqore --all-files to evaluate the entire repository.
Was this helpful?
Valqore Docs
Copyright © Cruip. All rights reserved.