question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

terraform fmt isn't called

See original GitHub issue

Hello,

I’m looking at the config, and I would expect that terraform fmt be run when I execute a save: command s on the Mac.

    "enable": true,
    "ignoreExtensionsOnSave": [
      ".tfsmurf"
    ],
    "formatOnSave": true
   },

I am using VS Code 1.22.2, plugin 0.0.23 of the plugin, and am running OSX 10.13.4, this was previously working, so I’m not sure why it stopped. I don’t see any obvious mentions in the Console log or the Dev Tools. Nothing is registered when I execute command s. Running terraform fmt from bash does what I expect.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
danieladams456commented, Apr 30, 2018

My extension seems to have been updated and experiencing the same issue. Here is my config, but I should just be able to use the default. Terraform should be in $PATH for VS Code, but I explicitly set it anyway. My files are correctly marked as Terraform and not HCL.

"terraform.format": {
    "enable": true,
    "formatOnSave": true
},
"terraform.path": "/usr/local/bin/terraform",

VSCode version 1.22.2, Terraform plugin version 1.0.3

2reactions
danieladams456commented, Apr 30, 2018

No, nothing on any of the output selectors including Extensions and Extension Host. No Terraform output in the drop-down.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command: fmt | Terraform - HashiCorp Developer
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. This command applies a subset of...
Read more >
Using Terraform fmt Command to Format Your Terraform Code
The Terraform fmt command is used to format your configuration files into a canonical format and style. Learn how it can keep your...
Read more >
Formatting Terraform Code With the Terraform fmt Command
Learn how to prettify them using the Terraform fmt command in this ... Create a folder named terraform-s3-demo on your home directory.
Read more >
Why is `terraform fmt` outputting a filename when it doesn't ...
-check flag also implies -write=false . From Terraform doc: -write=false - Don't overwrite the input files. (This is implied by -check or ...
Read more >
circleci/terraform@3.2.0
Deploy your infrastructure via a CircleCI pipeline using the Terraform orb. ... Execute 'terraform fmt' in specified module path. Show command Source ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found