hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
373 stars 66 forks source link

hclwrite: Fix improper indent calculation inside heredocs #107

Closed nozaq closed 4 years ago

nozaq commented 5 years ago

Potential fix for #106.

linesForFormat function already put all tokens in one heredoc into one formatLine instance, so formatIndent function does not need to go through multiple lines to find the corresponding TokenCHeredoc. Instead, it can just ignore the whole line.

hashicorp-cla commented 5 years ago

CLA assistant check
All committers have signed the CLA.

codecov-io commented 5 years ago

Codecov Report

Merging #107 into master will increase coverage by 0.03%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   68.69%   68.72%   +0.03%     
==========================================
  Files          98       98              
  Lines       10299    10293       -6     
==========================================
- Hits         7075     7074       -1     
+ Misses       2897     2894       -3     
+ Partials      327      325       -2
Impacted Files Coverage Δ
hclwrite/format.go 95.59% <100%> (+2.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4b22149...25cac01. Read the comment docs.