Releases: hashicorp/hcl
Releases · hashicorp/hcl
v2.5.0
v2.4.0
v2.4.0 (Apr 13, 2020)
Enhancements
- The Unicode data tables that HCL uses to produce user-perceived "column" positions in diagnostics and other source ranges are now updated to Unicode 12.0.0, which will cause HCL to produce more accurate column numbers for combining characters introduced to Unicode since Unicode 9.0.0.
Bugs Fixed
- json: Fix panic when parsing malformed JSON. (#358)
v2.3.0
Enhancements
- ext/tryfunc: Optional functions
try
andcan
to include in yourhcl.EvalContext
when evaluating expressions, which allow users to make decisions based on the success of expressions. (#330) - ext/typeexpr: Now has an optional function
convert
which you can include in yourhcl.EvalContext
when evaluating expressions, allowing users to convert values to specific type constraints using the type constraint expression syntax. (#330) - ext/typeexpr: A new
cty
capsule typetypeexpr.TypeConstraintType
which, when used as either a type constraint for a function parameter or as a type constraint for ahcldec
attribute specification will cause the given expression to be interpreted as a type constraint expression rather than a value expression. (#330) - ext/customdecode: An optional extension that allows overriding the static decoding behavior for expressions either in function arguments or
hcldec
attribute specifications. (#330) - ext/customdecode: New
cty
capsuletypescustomdecode.ExpressionType
andcustomdecode.ExpressionClosureType
which, when used as either a type constraint for a function parameter or as a type constraint for ahcldec
attribute specification will cause the given expression (and, for the closure type, also thehcl.EvalContext
it was evaluated in) to be captured for later analysis, rather than immediately evaluated. (#330)
v2.2.0
Enhancements
- hcldec: Attribute evaluation (as part of
AttrSpec
orBlockAttrsSpec
) now captures expression evaluation metadata in any errors it produces during type conversions, allowing for better feedback in calling applications that are able to make use of this metadata when printing diagnostic messages. (#329)
Bugs Fixed
- hclsyntax:
IndexExpr
,SplatExpr
, andRelativeTraversalExpr
will now report a source range that covers all of their child expression nodes. Previously they would report only the operator part, such as["foo"]
,[*]
, or.foo
, which was problematic for callers using source ranges for code analysis. (#328) - hclwrite: Parser will no longer panic when the input includes index, splat, or relative traversal syntax. (#328)
v2.1.0
Enhancements
- gohcl: When decoding into a struct value with some fields already populated, those values will be retained if not explicitly overwritten in the given HCL body, with similar overriding/merging behavior as
json.Unmarshal
in the Go standard library. - hclwrite: New interface to set the expression for an attribute to be a raw token sequence, with no special processing. This has some caveats, so if you intend to use it please refer to the godoc comments. (#320)
Bugs Fixed
- hclwrite: The
Body.Blocks
method was returing the blocks in an indefined order, rather than preserving the order of declaration in the source input. (#313) - hclwrite: The
TokensForTraversal
function (and thus in turn theBody.SetAttributeTraversal
method) was not correctly handling index steps in traversals, and thus producing invalid results. (#319)
v2.0.0
Initial release of HCL 2, which is a new implementation combining the HCL 1 language with the HIL expression language to produce a single language supporting both nested configuration structures and arbitrary expressions.
HCL 2 has an entirely new Go library API and so is not a drop-in upgrade relative to HCL 1. It's possible to import both versions of HCL into a single program using Go's semantic import versioning mechanism:
import (
hcl1 "github.com/hashicorp/hcl"
hcl2 "github.com/hashicorp/hcl/v2"
)
v2.0.0-alpha.1
v2.0.0-alpha.1