From 21feeef3183796453794cf6988417158d4741286 Mon Sep 17 00:00:00 2001 From: Oscar Blue Date: Sun, 9 Jul 2023 17:03:05 +0100 Subject: [PATCH] Added basic pre-commit config --- .pre-commit-config.yaml | 10 ++++++++++ Makefile | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ce843a2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/gitleaks/gitleaks + rev: v8.16.1 + hooks: + - id: gitleaks + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.81.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases + hooks: + - id: terraform_fmt + # - id: terraform_docs \ No newline at end of file diff --git a/Makefile b/Makefile index 4995b92..4721065 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ CODE_PATH ?= . +pre-commit: + @cd $(CODE_PATH) && pre-commit run --files * + init: @cd $(CODE_PATH) && terraform init -reconfigure -upgrade -backend-config=./backend.tfvars