From 6130dc337aa6fd4309c15735d3cc46bc82cc1b51 Mon Sep 17 00:00:00 2001 From: Roman Schwarz Date: Thu, 19 Sep 2024 15:42:04 +0200 Subject: [PATCH] Add `tfsort` to pre-commit hooks Signed-off-by: Roman Schwarz --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d7deda..de7db89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,14 @@ repos: hooks: - id: terraform-docs-system args: ["."] + - repo: local + hooks: + - id: tfsort + name: Sort Terraform variables + language: system + types: [terraform] + entry: bash -c 'for f in $@; do tfsort "$f"; done' -- + files: ^variables|outputs\.tf$ - repo: https://github.com/antonbabenko/pre-commit-terraform rev: "v1.92.0" hooks: