This repository contains JOSA's custom pre-commit hooks.
-
Validate Flux - A script to validate Flux custom resources and Kustomize overlays.
-
Validate Eslint - A script to validate eslint rules on Javascript and Typescript files.
-
Run Samplr - A script to generate sample files.
This script downloads the Flux OpenAPI schemas, then it validates the
Flux custom resources and the kustomize
overlays using kubeconform
.
This script is meant to be run locally and in CI before the changes.
You need the following to be installed on your machine before running this pre-commit script.
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/jordanopensource/pre-commit-hooks
rev: v0.1.0 # Use the ref you want to point at
hooks:
- id: validate-flux
# - id: ...
After the configuration is added, you'll need to run
pre-commit install -t pre-push
This script runs eslint rule checks on staged files that have the following extensions:
- ts
- tsx
- vue
- js
- jsx
You need the following to be installed on your machine before running this pre-commit script.
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/jordanopensource/pre-commit-hooks
rev: v0.2.0 # Use the ref you want to point at
hooks:
- id: validate-eslint
# - id: ...
After the configuration is added, you'll need to run
pre-commit install -t pre-commit
This script runs the command samplr to generate .sample
files in your repo. Please refer to the config in this repo to understand which files are supported.
You need the following to be installed on your machine before running this pre-commit script.
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/jordanopensource/pre-commit-hooks
rev: v0.1.0 # Use the ref you want to point at
hooks:
- id: run-samplr
# - id: ...
After the configuration is added, you'll need to run
pre-commit install -t pre-commit