Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ if command_exists typos; then
echo "$files" | xargs typos
fi

if command_exists terraform; then
# `terraform fmt` doesn't ignore non-tf files automatically
tf_files=$(echo "$files" | { grep -E '\.tf$' || true; })

echo "$tf_files" | xargs terraform fmt
fi

if command_exists terraform-docs; then
for tf_module in $tf_modules; do
terraform-docs markdown "$tf_module" --output-file "README.md"
Expand Down