mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 20:44:33 +07:00
feat: add pre-commit hooks
This commit is contained in:
parent
c3f4433a1a
commit
214f635697
27
.pre-commit-config.yaml
Normal file
27
.pre-commit-config.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-merge-conflict
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: detect-private-key
|
||||
- id: end-of-file-fixer
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/adrienverge/yamllint
|
||||
rev: v1.27.1
|
||||
hooks:
|
||||
- id: yamllint
|
||||
- repo: https://github.com/k8s-at-home/sops-pre-commit
|
||||
rev: v2.1.1
|
||||
hooks:
|
||||
- id: forbid-secrets
|
||||
- repo: https://github.com/gruntwork-io/pre-commit
|
||||
rev: v0.1.17
|
||||
hooks:
|
||||
- id: helmlint
|
||||
- id: shellcheck
|
||||
- id: terraform-fmt
|
||||
- id: terraform-validate
|
6
Makefile
6
Makefile
@ -26,9 +26,6 @@ wait:
|
||||
tools:
|
||||
make -C tools
|
||||
|
||||
docs:
|
||||
make -C docs
|
||||
|
||||
dev:
|
||||
make -C metal cluster env=dev
|
||||
make -C bootstrap
|
||||
@ -41,3 +38,6 @@ docs:
|
||||
--publish 8000:8000 \
|
||||
--volume $(shell pwd):/docs \
|
||||
squidfunk/mkdocs-material
|
||||
|
||||
git-hooks:
|
||||
pre-commit install
|
||||
|
@ -231,6 +231,7 @@ References:
|
||||
- [Official Cloudflare Tunnel examples](https://github.com/cloudflare/argo-tunnel-examples)
|
||||
- [Initialize GitOps repository on Gitea and integrate with Tekton by RedHat](https://github.com/redhat-scholars/tekton-tutorial/tree/master/triggers)
|
||||
- [SSO configuration from xUnholy/k8s-gitops](https://github.com/xUnholy/k8s-gitops)
|
||||
- [Pre-commit config from k8s-at-home/flux-cluster-template](https://github.com/k8s-at-home/flux-cluster-template)
|
||||
|
||||
Here is a list of the contributors who have helped to improve this project.
|
||||
Big shout-out to them!
|
||||
|
17
docs/tutorials/install-pre-commit-hooks.md
Normal file
17
docs/tutorials/install-pre-commit-hooks.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Install pre-commit hooks
|
||||
|
||||
> TODO: organize developer-focused documentation
|
||||
|
||||
Git hook scripts are useful for identifying simple issues before commiting changes.
|
||||
|
||||
Install [pre-commit](https://pre-commit.com/#install) first, one-liner for Arch users:
|
||||
|
||||
```sh
|
||||
sudo pacman -S python-pre-commit
|
||||
```
|
||||
|
||||
Then install git hook scripts:
|
||||
|
||||
```sh
|
||||
make git-hooks
|
||||
```
|
@ -32,7 +32,9 @@ RUN pacman --sync --refresh --noconfirm \
|
||||
python-kubernetes \
|
||||
python-netaddr \
|
||||
python-pip \
|
||||
python-pre-commit \
|
||||
python-rich \
|
||||
shellcheck \
|
||||
sudo \
|
||||
terraform \
|
||||
yamllint
|
||||
|
Loading…
Reference in New Issue
Block a user