"fmt" exit status

273 views
Skip to first unread message

Murray S. Kucherawy

unread,
Apr 30, 2021, 10:23:06 AM4/30/21
to terrafo...@googlegroups.com
Hi all,

What does an exit status of 2 mean when I run "fmt" without "-check"?  No path is being provided as an argument.  The documentation is not clear about this; "-check" is the only place where discussion of the exit status is present, but I'm not using it.

Thanks,

-MSK

Lucas Possamai

unread,
May 17, 2021, 6:49:38 AM5/17/21
to terrafo...@googlegroups.com
On Sat, 1 May 2021 at 02:23, Murray S. Kucherawy <supe...@gmail.com> wrote:
Hi all,

What does an exit status of 2 mean when I run "fmt" without "-check"?  No path is being provided as an argument.  The documentation is not clear about this; "-check" is the only place where discussion of the exit status is present, but I'm not using it.

It means that Terraform failed to format your files (it needs arguments, from memory). You can run terraform fmt -diff to check the syntax and then terraform fmt -check to validate it. If the last command returns nothing, it means FMT was successful.

Lucas

Murray S. Kucherawy

unread,
May 25, 2021, 1:35:47 AM5/25/21
to terrafo...@googlegroups.com
I'm running it with "-diff -write=false", and it exits 2 with no output.  It doesn't tell me why it failed to format; it's completely silent.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/CAE_gQfWKbwgBb5HExoY%3DyUho8_NAEmSDFRgsx%3DAJL-gTyUAoGw%40mail.gmail.com.

Richard Jennings

unread,
May 25, 2021, 2:06:33 AM5/25/21
to terrafo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages