File tree Expand file tree Collapse file tree 4 files changed +27
-18
lines changed
Expand file tree Collapse file tree 4 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 66 files : secrets.yml
77 types : [text]
88
9- - id : terraform -fmt
10- name : Check Terraform Format
9+ - id : tf -fmt
10+ name : Check TF Format
1111 description : This hook checks Terraform is formatteed correctly
12- entry : bin/terraform -fmt.sh
12+ entry : bin/tf -fmt.sh
1313 language : script
1414 files : \.(tf)$
1515 types : [terraform]
1616
17- - id : terraform -lint
18- name : Check Terraform Lint
17+ - id : tf -lint
18+ name : Check TF Lint
1919 description : This hook checks Terraform lint
20- entry : bin/terraform -lint.sh
20+ entry : bin/tf -lint.sh
2121 language : script
2222 files : \.(tf)$
2323 types : [terraform]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # LICENSE: The MIT License Copyright (c) 2023,2025 Volt Grid Pty Ltd t/a Panubo
4+
5+ # Runs Tofu or Terraform Format
6+
7+ set -e
8+
9+ if command -v tofu & > /dev/null; then
10+ TF_CMD=' tofu'
11+ elif command -v terraform & > /dev/null; then
12+ TF_CMD=' terraform'
13+ else
14+ echo " Error: Neither 'tofu' nor 'terraform' found in PATH." >&2
15+ exit 1
16+ fi
17+
18+ echo " Running pre-commit checks..."
19+ for FILE in " ${@ } " ; do
20+ TF_CMD fmt " ${FILE} "
21+ done
File renamed without changes.
You can’t perform that action at this time.
0 commit comments