Open tyron opened 3 years ago
@brikis98 , @yorinasub17 please let me know if this is OK to be reviewed, or if you'd prefer that we don't revert the default behaviour -- rather just expose the flag to switch to the old one.
Any movement on this? Seems a few folks would like old behavior
Just my 2cents:
I thought with 1.1.17 this would have been fixed by now. Because it is not, I will still continue using 0.1.11 for auto format files.
+1 on this change. Printing the diff is not as useful as auto-correcting the styling.
Is there anything what I can do to make that change happen?
If anyone interested that change can be easily tested eg. via:
- repo: https://github.com/gruntwork-io/pre-commit
rev: 837cfa83f27ec2dd4a4c6860b2a6ca9392642fe0
hooks:
- id: terraform-fmt
- id: terraform-validate
exclude: terragrunt/modules
while this is not complete its better then the current fuctionality
Can we get some traction on this. The previous functionality is much nicer.
Also waiting on this functionality
Would be good to see this functionality
I found this functionality in another repository: https://github.com/antonbabenko/pre-commit-terraform?tab=readme-ov-file#terraform_fmt
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.92.2
hooks:
- id: terraform_fmt
Restore terraform-fmt behaviour from v0.1.11. Fixes #48.
By default, changes are written back to source files as usual for pre-commit hooks, but can be optionally disabled by providing a
--no-autofix
flag to terraform-fmt.