From 3d310bce8ddc932afeed57cc8339e52716ca2acd Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Wed, 28 Apr 2021 23:19:12 +0300
Subject: [PATCH] Scaffolding.

---
 .pre-commit-hooks.yaml | 14 ++++++++++++++
 tff                    |  4 ++++
 tfv                    |  4 ++++
 3 files changed, 22 insertions(+)
 create mode 100644 .pre-commit-hooks.yaml
 create mode 100755 tff
 create mode 100755 tfv

diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
new file mode 100644
index 0000000..76cf021
--- /dev/null
+++ b/.pre-commit-hooks.yaml
@@ -0,0 +1,14 @@
+---
+- id: tf-fmt
+  name: Format Terraform files
+  description: Format Terraform files using terraform fmt
+  language: script
+  types: [terraform]
+  entry: tff
+
+- id: tf-validate
+  name: Validate Terraform modules
+  description: Validate Terraform modules using terraform validate
+  language: script
+  types: [terraform]
+  entry: tfv
diff --git a/tff b/tff
new file mode 100755
index 0000000..1d4850b
--- /dev/null
+++ b/tff
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+
+command -v terraform >/dev/null || { echo "Can't find the terraform binary, aborting." >&2; exit 1; }
diff --git a/tfv b/tfv
new file mode 100755
index 0000000..1d4850b
--- /dev/null
+++ b/tfv
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+
+command -v terraform >/dev/null || { echo "Can't find the terraform binary, aborting." >&2; exit 1; }
-- 
GitLab