yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.15k stars 121 forks source link

Use kubeconform as a pre-commit hook #198

Open Klavionik opened 1 year ago

Klavionik commented 1 year ago

I would like to use kubeconform as a pre-commit hook in my projects, so I tried and added a simple pre-commit manifest to the repo. I tested it briefly, and it seem to work fine.

The only unusual thing I had to do was to set require_serial: true in the manifest. That prevents pre-commit from calling kubeconform in parallel. I found it rather confusing, and I guess one should manage concurrency at kubeconform level (using the -n flag).