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

hclpack: Fix name range for unsupported attribute #98

Closed akupila closed 5 years ago

akupila commented 5 years ago

Fixes an issue where the name range may be incorrect in case there are multiple attributes and one of them is wrong. Another attribute's name range could overwrite the previous one as the attr variable is overwritten in the for loop.

The fix is essentially the same as https://github.com/hashicorp/hcl2/pull/73

Note: there are no tests for this but that's mostly because there were no existing tests for checking diagnostics.

codecov-io commented 5 years ago

Codecov Report

Merging #98 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #98   +/-   ##
=======================================
  Coverage   68.55%   68.55%           
=======================================
  Files          97       97           
  Lines       10186    10186           
=======================================
  Hits         6983     6983           
  Misses       2877     2877           
  Partials      326      326
Impacted Files Coverage Δ
hclpack/structure.go 45.23% <0%> (ø) :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 2c5a4b7...8ad1a62. Read the comment docs.

akupila commented 5 years ago

Apparently the build fails on missing tests. I'll need to revisit this when i have some more time

apparentlymart commented 5 years ago

Thanks @akupila!

And indeed, the test coverage for hclpack is not great because as it currently stands it's still pretty-much just an experiment, so don't worry too much about the codecov reports for this one. I'll merge this once the Travis-CI run completes as long as nothing else is failing as a result (which I doubt).

akupila commented 5 years ago

Great, thanks for the quick response!