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 on save not actually occurring

See original GitHub issue

If have Format on Save enabled, and on saving a .tf file, the output shows it running terraform fmt on the file:

2019-03-29 15:15:41:274 [INFO ] formatting-provider: running 'terraform fmt' on 'c:\Users\user\project-dir\main.tf'
2019-03-29 15:15:41:275 [INFO ] runner: Running terraform cwd='C:\Users\user\AppData\Local\Programs\Microsoft VS Code' path='terraform' (version: 0.11.11) args=[fmt, -]
2019-03-29 15:15:42:492 [INFO ] file-system-watcher: Indexed file:///c%3A/Users/user/project-dir/main.tf
2019-03-29 15:15:44:340 [INFO ] runner: Running terraform succeeded.

However, the formatting is not applied and file remains unchanged.

Running terraform fmt on the file via the console has the expected formatting effect on the file.

_This issue was also mentioned by @IronFarm in https://github.com/mauve/vscode-terraform/issues/62#issuecomment-426944230_

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
paultyngcommented, Jun 4, 2020

We just released v2.0.0-rc.1 of the extension. The main features include:

  • Added syntax support for 0.12
  • Added terraform-ls usage by default (currently on 0.3.0, which offers basic provider code completion)

You can find additional information and specifics in the release notes and CHANGELOG.

With this release we expect that many of the prior issues and PRs are no longer relevant or have been addressed, and are therefore being closed. If you feel the action taken on an issue or PR is in error, please comment as such and we can figure out the appropriate way to address it.

We plan to add the final 2.0.0 release to the marketplace soon, but are actively seeking your feedback now on the release candidates. You can download the .vsix from the releases page and manually install it in VS Code to try it out.

0reactions
ghostcommented, Jul 4, 2020

I’m going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

terraform -fmt --recursive not doing anything / not working
When running terraform fmt --recursive none of my terraform files are actually getting formatted. For example, some code in terraform version v0 ...
Read more >
How to Auto Format Terraform Code in Visual Studio Code
Courses: https://www.aosnote.com/storeWebsite: https://www.aosnote.com/This video will teach you how to automatically format Terraform code ...
Read more >
VSCode plugin very slow at terraform fmt on save - Reddit
The issue I'm having with the VSCode Terraform plugin is that when it saves a file it's taking nearly 5 seconds to terraform...
Read more >
Pre-Commit Hooks for Terraform - Medium
This rule only checks for the tagging keys rather than the value. This will also not check if tags are being set as...
Read more >
Developers - formatter does not the same as "terraform fmt" -
The formatter of the HCL plugin which is called on save does not the same as "terraform fmt". Prerequisites. [ ] Ensure you...
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