pre-commit-terraform icon indicating copy to clipboard operation
pre-commit-terraform copied to clipboard

It should show the file path when something is changed or goes wrong

Open robsonpeixoto opened this issue 5 years ago β€’ 5 comments

When something get wrong, it doesn't show the file path and it is very useful.

❯ git commit -v
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/robinho/.cache/pre-commit/patch1562252730.
Terraform fmt............................................................Failed
hookid: terraform_fmt

Files were modified by this hook. Additional output:

cluster.tf

Error: Invalid block definition

  on vars.tf line 20:
  (source code not available)

A block definition must have block content delimited by "{" and "}", starting
on the same line as the block header.

robsonpeixoto avatar Jul 04 '19 16:07 robsonpeixoto

Oh just noticed I created a duplicate of this (#161) and a PR to fix it (#162)

varac avatar Dec 02 '20 14:12 varac

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Oct 04 '21 00:10 github-actions[bot]

@MaxymVlasov Let's make sure that the path is also shown for all other hooks we have (including tflint, tfsec, fmt).

antonbabenko avatar Oct 04 '21 08:10 antonbabenko

Did you get anywhere with this? Appreciate the world is pretty F'd up right now. No rush at all.

It's pretty irritating getting messages like this though.

Terragrunt validate......................................................Failed
- hook id: terragrunt_validate
- files were modified by this hook

david-heward-unmind avatar Apr 04 '22 16:04 david-heward-unmind

@MaxymVlasov Let's make sure that the path is also shown for all other hooks we have (including tflint, tfsec, fmt).

Any update on this?

albertorm95 avatar Dec 11 '23 12:12 albertorm95