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.

Allow controlling aspects of the automatic formatting

See original GitHub issue

With “format on save” enabled, this extension formats in a way that I find quite unpleasant:

resource "aws_ecr_repository" "repo" {
  name                 = "repo"
  image_tag_mutability = "IMMUTABLE"
}

I would much prefer this:

resource "aws_ecr_repository" "repo" {
  name = "repo"
  image_tag_mutability = "IMMUTABLE"
}

Is there any way to adjust this, and if not, could some basic formatting knobs be added?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
radeksimkocommented, Apr 26, 2021

Hi @jbg What you see here is the intended behavior of terraform fmt. Specifically, the alignment of equals signs only happens for consecutive runs of single-line arguments. Multi-line arguments are considered to be an entirely separate “group” (with only one item) for alignment purposes, because the benefit of easily scanning over the values doesn’t apply when the value itself isn’t positioned relative to the equals sign anyway.

As with all of the terraform fmt formatting decisions, this is a subjective and therefore essentially arbitrary decision based on tradeoffs made by the original implementer, and it’s unlikely to change because that would cause changes for everyone who had previously formatted examples like this with terraform fmt in earlier versions. The bar for changes to existing terraform fmt layout behaviors is very high, and would typically need to have a strong and objective (rather than subjective) justification to warrant causing diffs for all existing Terraform configurations after upgrading.

0reactions
github-actions[bot]commented, Jun 5, 2021

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 details necessary to investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Stop Word from Changing Formatting Automatically
You can stop Word from changing formatting automatically in your documents by turning off AutoFormat As You Type settings in the AutoCorrect dialog...
Read more >
Microsoft Excel: How to turn off Excel's AutoFormat feature
A. A few options exist for controlling some of Excel's AutoFormat behavior from the File tab by selecting Options, Proofing, AutoCorrect options ...
Read more >
Turn on or off automatic bullets or numbering - Microsoft Support
Select AutoCorrect Options, and then select the AutoFormat As You Type tab. Select or clear Automatic bulleted lists or Automatic numbered lists. Select...
Read more >
AutoFormat (Microsoft Word)
Word has several AutoFormat functions that make formatting changes based on what you have typed. Word gives you control over which automatic formatting...
Read more >
How to Turn Off Automatic Changes in Microsoft Word ...
The time-saving automation features are supported by Microsoft Word 365, Word 2019, Word 2016, Word 2013, and earlier versions.
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