From 347aac2ae2632473aede4ec70a3e7e9775c7bad7 Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Mon, 29 Sep 2025 13:07:06 +0200 Subject: [PATCH] Add a config for `pre-commit` hook; Makefile targets for formatting --- .pre-commit-config.yaml | 11 +++++++++++ Makefile | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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..cfc98a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.100.1 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases + hooks: + - id: terraform_fmt diff --git a/Makefile b/Makefile index 8f278a5..48265c5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ -.PHONY: docs +.PHONY: docs fmt docs: $(MAKE) -C modules docs $(MAKE) -C examples docs + +fmt: + terraform fmt -recursive + +fmt-check: + terraform fmt -recursive -check