From 117baa8bf53bc2050fe5e0f2ab85c4ef9341d20e Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Wed, 21 Aug 2024 15:32:07 +0200 Subject: [PATCH 1/4] feat: return an ExprSyntaxError for invalid references that end in a dot (commonly occurs in editors for completions) Detect value expressions of the ExprSyntaxError type when parsing object constructor expressions and use them to add an item to the result even though we skip parsing the object due to recovery after the invalid expression. This allows the Terraform language server to support completions for object attributes after a dot was typed. --- hclsyntax/parser.go | 23 ++++++++++-- hclsyntax/parser_test.go | 81 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 3 deletions(-) diff --git a/hclsyntax/parser.go b/hclsyntax/parser.go index ce96ae35..fec7861a 100644 --- a/hclsyntax/parser.go +++ b/hclsyntax/parser.go @@ -811,9 +811,16 @@ Traversal: // will probably be misparsed until we hit something that // allows us to re-sync. // - // We will probably need to do something better here eventually - // in order to support autocomplete triggered by typing a - // period. + // Returning an ExprSyntaxError allows us to pass more information + // about the invalid expression to the caller, which can then + // use this for example for completions that happen after typing + // a dot in an editor. + ret = &ExprSyntaxError{ + Placeholder: cty.DynamicVal, + ParseDiags: diags, + SrcRange: hcl.RangeBetween(from.Range(), dot.Range), + } + p.setRecovery() } @@ -1516,6 +1523,16 @@ func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { diags = append(diags, valueDiags...) if p.recovery && valueDiags.HasErrors() { + // If the value is an ExprSyntaxError, we can add an item with it, even though we will recover afterwards + // This allows downstream consumers to still retrieve this first invalid item, even though following items + // won't be parsed. This is useful for supplying completions. + if exprSyntaxError, ok := value.(*ExprSyntaxError); ok { + items = append(items, ObjectConsItem{ + KeyExpr: key, + ValueExpr: exprSyntaxError, + }) + } + // If expression parsing failed then we are probably in a strange // place in the token stream, so we'll bail out and try to reset // to after our closing brace to allow parsing to continue. diff --git a/hclsyntax/parser_test.go b/hclsyntax/parser_test.go index 10825f15..66f1308f 100644 --- a/hclsyntax/parser_test.go +++ b/hclsyntax/parser_test.go @@ -2672,6 +2672,87 @@ block "valid" {} }, }, }, + { + "a = { b = c. }", + 1, + &Body{ + Attributes: Attributes{ + "a": { + Name: "a", + Expr: &ObjectConsExpr{ + Items: []ObjectConsItem{ + { + KeyExpr: &ObjectConsKeyExpr{ + Wrapped: &ScopeTraversalExpr{ + Traversal: hcl.Traversal{ + hcl.TraverseRoot{ + Name: "b", + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 7, Byte: 6}, + End: hcl.Pos{Line: 1, Column: 8, Byte: 7}, + }, + }, + }, + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 7, Byte: 6}, + End: hcl.Pos{Line: 1, Column: 8, Byte: 7}, + }, + }, + }, + ValueExpr: &ExprSyntaxError{ + Placeholder: cty.DynamicVal, + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 11, Byte: 10}, + End: hcl.Pos{Line: 1, Column: 13, Byte: 12}, + }, + ParseDiags: hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid attribute name", + Detail: "An attribute name is required after a dot.", + Subject: &hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 14, Byte: 13}, + End: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + }, + }, + }, + }, + }, + }, + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 5, Byte: 4}, + End: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + }, + OpenRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 5, Byte: 4}, + End: hcl.Pos{Line: 1, Column: 6, Byte: 5}, + }, + }, + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 1, Byte: 0}, + End: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + }, + NameRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 1, Byte: 0}, + End: hcl.Pos{Line: 1, Column: 2, Byte: 1}, + }, + EqualsRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 3, Byte: 2}, + End: hcl.Pos{Line: 1, Column: 4, Byte: 3}, + }, + }, + }, + Blocks: Blocks{}, + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 1, Byte: 0}, + End: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + }, + EndRange: hcl.Range{ + Start: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + End: hcl.Pos{Line: 1, Column: 15, Byte: 14}, + }, + }, + }, } for _, test := range tests { From f68c58fb4d7c83cd334f3eebe10f045f541e435e Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Thu, 22 Aug 2024 11:01:00 +0200 Subject: [PATCH 2/4] Update Changelog.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f81110dc..003fbdb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # HCL Changelog +## v2.22.0 (Unreleased) + +### Enhancements + +* feat: return an ExprSyntaxError for invalid references that end in a dot ([#692](https://github.com/hashicorp/hcl/pull/692)) + ## v2.21.0 (June 19, 2024) ### Enhancements From 141e3dbf5956904ad1920241148b406d69b2aae0 Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Mon, 26 Aug 2024 14:41:43 +0200 Subject: [PATCH 3/4] Prepare for v2.22.0 release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 003fbdb0..b2ff2631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # HCL Changelog -## v2.22.0 (Unreleased) +## v2.22.0 (August 26, 2024) ### Enhancements From d60ff2f90fd024ee0e9894973adb1b6b8f94aac8 Mon Sep 17 00:00:00 2001 From: i4k Date: Wed, 28 Aug 2024 16:27:41 +0100 Subject: [PATCH 4/4] chore: adjust fork. Signed-off-by: i4k --- .github/dependabot.yml | 2 +- .github/workflows/checks.yml | 2 +- cmd/hcldec/diags_json.go | 2 +- cmd/hcldec/main.go | 6 +++--- cmd/hcldec/spec.go | 8 ++++---- cmd/hcldec/type_expr.go | 2 +- cmd/hcldec/vars.go | 2 +- cmd/hclfmt/main.go | 6 +++--- cmd/hclspecsuite/diagnostics.go | 2 +- cmd/hclspecsuite/log.go | 2 +- cmd/hclspecsuite/main.go | 4 ++-- cmd/hclspecsuite/runner.go | 6 +++--- cmd/hclspecsuite/test_file.go | 6 +++--- cmd/hclspecsuite/traversals.go | 2 +- ext/customdecode/customdecode.go | 2 +- ext/customdecode/expression_type.go | 2 +- ext/dynblock/expand_body.go | 2 +- ext/dynblock/expand_body_test.go | 6 +++--- ext/dynblock/expand_spec.go | 2 +- ext/dynblock/expr_wrap.go | 2 +- ext/dynblock/iteration.go | 2 +- ext/dynblock/options.go | 2 +- ext/dynblock/public.go | 2 +- ext/dynblock/schema.go | 2 +- ext/dynblock/unknown_body.go | 4 ++-- ext/dynblock/variables.go | 2 +- ext/dynblock/variables_hcldec.go | 4 ++-- ext/dynblock/variables_test.go | 6 +++--- ext/transform/error.go | 2 +- ext/transform/transform.go | 2 +- ext/transform/transform_test.go | 4 ++-- ext/transform/transformer.go | 2 +- ext/tryfunc/tryfunc.go | 4 ++-- ext/tryfunc/tryfunc_test.go | 4 ++-- ext/typeexpr/get_type.go | 2 +- ext/typeexpr/get_type_test.go | 8 ++++---- ext/typeexpr/public.go | 4 ++-- ext/typeexpr/type_type.go | 7 ++++--- ext/userfunc/decode.go | 2 +- ext/userfunc/decode_test.go | 4 ++-- ext/userfunc/public.go | 2 +- fuzz/oss_fuzz_build.sh | 2 +- go.mod | 2 +- gohcl/decode.go | 2 +- gohcl/decode_test.go | 4 ++-- gohcl/encode.go | 2 +- gohcl/encode_test.go | 4 ++-- gohcl/schema.go | 2 +- gohcl/schema_test.go | 2 +- gohcl/types.go | 2 +- guide/go_decoding_gohcl.rst | 2 +- guide/go_decoding_hcldec.rst | 2 +- guide/go_decoding_lowlevel.rst | 2 +- guide/go_parsing.rst | 2 +- hcldec/block_labels.go | 2 +- hcldec/decode.go | 2 +- hcldec/public.go | 2 +- hcldec/public_test.go | 4 ++-- hcldec/schema.go | 2 +- hcldec/spec.go | 4 ++-- hcldec/spec_test.go | 4 ++-- hcldec/variables.go | 2 +- hcldec/variables_test.go | 4 ++-- hcled/navigation.go | 2 +- hclparse/parser.go | 6 +++--- hclsimple/hclsimple.go | 8 ++++---- hclsimple/hclsimple_test.go | 2 +- hclsyntax/diagnostics.go | 2 +- hclsyntax/expression.go | 4 ++-- hclsyntax/expression_ops.go | 2 +- hclsyntax/expression_static_test.go | 2 +- hclsyntax/expression_template.go | 2 +- hclsyntax/expression_template_test.go | 2 +- hclsyntax/expression_test.go | 2 +- hclsyntax/expression_typeparams_test.go | 2 +- hclsyntax/expression_vars.go | 2 +- hclsyntax/expression_vars_gen.go | 2 +- hclsyntax/file.go | 2 +- hclsyntax/fuzz/Makefile | 2 +- hclsyntax/fuzz/fuzz_test.go | 4 ++-- hclsyntax/navigation.go | 2 +- hclsyntax/navigation_test.go | 2 +- hclsyntax/node.go | 2 +- hclsyntax/parse_traversal_test.go | 2 +- hclsyntax/parser.go | 2 +- hclsyntax/parser_template.go | 2 +- hclsyntax/parser_test.go | 2 +- hclsyntax/parser_traversal.go | 2 +- hclsyntax/peeker.go | 2 +- hclsyntax/public.go | 2 +- hclsyntax/public_test.go | 2 +- hclsyntax/scan_tokens.go | 2 +- hclsyntax/scan_tokens.rl | 2 +- hclsyntax/scan_tokens_test.go | 2 +- hclsyntax/structure.go | 2 +- hclsyntax/structure_at_pos.go | 2 +- hclsyntax/structure_at_pos_test.go | 2 +- hclsyntax/structure_test.go | 2 +- hclsyntax/token.go | 2 +- hclsyntax/token_test.go | 2 +- hclsyntax/variables.go | 2 +- hclsyntax/variables_test.go | 2 +- hclsyntax/walk.go | 2 +- hclsyntax/walk_test.go | 2 +- hcltest/mock.go | 4 ++-- hcltest/mock_test.go | 2 +- hclwrite/ast_attribute.go | 2 +- hclwrite/ast_block.go | 2 +- hclwrite/ast_block_test.go | 4 ++-- hclwrite/ast_body.go | 4 ++-- hclwrite/ast_body_test.go | 4 ++-- hclwrite/ast_expression.go | 4 ++-- hclwrite/examples_test.go | 4 ++-- hclwrite/format.go | 2 +- hclwrite/format_test.go | 2 +- hclwrite/fuzz/Makefile | 2 +- hclwrite/fuzz/fuzz_test.go | 4 ++-- hclwrite/generate.go | 4 ++-- hclwrite/generate_test.go | 4 ++-- hclwrite/native_node_sorter.go | 2 +- hclwrite/parser.go | 12 ++++++------ hclwrite/parser_test.go | 4 ++-- hclwrite/public.go | 2 +- hclwrite/round_trip_test.go | 4 ++-- hclwrite/tokens.go | 4 ++-- integrationtest/convertfunc_test.go | 6 +++--- integrationtest/hcldec_into_expr_test.go | 8 ++++---- integrationtest/terraformlike_test.go | 12 ++++++------ json/ast.go | 2 +- json/fuzz/Makefile | 2 +- json/fuzz/fuzz_test.go | 2 +- json/is.go | 2 +- json/parser.go | 2 +- json/parser_test.go | 2 +- json/public.go | 2 +- json/public_test.go | 2 +- json/scanner.go | 2 +- json/scanner_test.go | 2 +- json/structure.go | 4 ++-- json/structure_test.go | 2 +- specsuite/spec_test.go | 4 ++-- 141 files changed, 212 insertions(+), 211 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 61e0aff8..33af935a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: - dependencies - automated reviewers: - - hashicorp/terraform-core + - terramate-io/cli-tooling # only update HashiCorp actions, external actions managed by TSCCR allow: - dependency-name: hashicorp/* diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a5f6b7af..79f160f8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -37,7 +37,7 @@ jobs: go-version-file: go.mod - name: Go test run: | - go test ./... -race + go test -race ./... copyright: name: "copyright headers" diff --git a/cmd/hcldec/diags_json.go b/cmd/hcldec/diags_json.go index f5939b9e..aa0026c8 100644 --- a/cmd/hcldec/diags_json.go +++ b/cmd/hcldec/diags_json.go @@ -7,7 +7,7 @@ import ( "encoding/json" "io" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type jsonDiagWriter struct { diff --git a/cmd/hcldec/main.go b/cmd/hcldec/main.go index 1ddc8006..c1f15753 100644 --- a/cmd/hcldec/main.go +++ b/cmd/hcldec/main.go @@ -11,10 +11,10 @@ import ( "os" "strings" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/hcl/v2/hclparse" flag "github.com/spf13/pflag" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2/hclparse" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ctyjson "github.com/zclconf/go-cty/cty/json" diff --git a/cmd/hcldec/spec.go b/cmd/hcldec/spec.go index a011d1c9..994137b8 100644 --- a/cmd/hcldec/spec.go +++ b/cmd/hcldec/spec.go @@ -6,10 +6,10 @@ package main import ( "fmt" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/userfunc" - "github.com/hashicorp/hcl/v2/gohcl" - "github.com/hashicorp/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/userfunc" + "github.com/terramate-io/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/cmd/hcldec/type_expr.go b/cmd/hcldec/type_expr.go index ed838d70..ac7cd07e 100644 --- a/cmd/hcldec/type_expr.go +++ b/cmd/hcldec/type_expr.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/cmd/hcldec/vars.go b/cmd/hcldec/vars.go index cf70136d..9c8d603d 100644 --- a/cmd/hcldec/vars.go +++ b/cmd/hcldec/vars.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/cmd/hclfmt/main.go b/cmd/hclfmt/main.go index aff04270..0e00670f 100644 --- a/cmd/hclfmt/main.go +++ b/cmd/hclfmt/main.go @@ -12,9 +12,9 @@ import ( "os" "strings" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclparse" - "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclparse" + "github.com/terramate-io/hcl/v2/hclwrite" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/hclspecsuite/diagnostics.go b/cmd/hclspecsuite/diagnostics.go index 97eb1df7..085f53a9 100644 --- a/cmd/hclspecsuite/diagnostics.go +++ b/cmd/hclspecsuite/diagnostics.go @@ -7,7 +7,7 @@ import ( "encoding/json" "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func decodeJSONDiagnostics(src []byte) hcl.Diagnostics { diff --git a/cmd/hclspecsuite/log.go b/cmd/hclspecsuite/log.go index b31937b2..0835530e 100644 --- a/cmd/hclspecsuite/log.go +++ b/cmd/hclspecsuite/log.go @@ -4,7 +4,7 @@ package main import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type LogBeginCallback func(testName string, testFile *TestFile) diff --git a/cmd/hclspecsuite/main.go b/cmd/hclspecsuite/main.go index 9f4ee604..1da4bd01 100644 --- a/cmd/hclspecsuite/main.go +++ b/cmd/hclspecsuite/main.go @@ -10,8 +10,8 @@ import ( "golang.org/x/crypto/ssh/terminal" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclparse" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclparse" ) func main() { diff --git a/cmd/hclspecsuite/runner.go b/cmd/hclspecsuite/runner.go index 11efa071..8f50a46d 100644 --- a/cmd/hclspecsuite/runner.go +++ b/cmd/hclspecsuite/runner.go @@ -19,9 +19,9 @@ import ( "github.com/zclconf/go-cty/cty/convert" ctyjson "github.com/zclconf/go-cty/cty/json" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/typeexpr" - "github.com/hashicorp/hcl/v2/hclparse" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/typeexpr" + "github.com/terramate-io/hcl/v2/hclparse" ) type Runner struct { diff --git a/cmd/hclspecsuite/test_file.go b/cmd/hclspecsuite/test_file.go index 95649d0f..ac440149 100644 --- a/cmd/hclspecsuite/test_file.go +++ b/cmd/hclspecsuite/test_file.go @@ -9,9 +9,9 @@ import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/typeexpr" - "github.com/hashicorp/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/typeexpr" + "github.com/terramate-io/hcl/v2/gohcl" ) type TestFile struct { diff --git a/cmd/hclspecsuite/traversals.go b/cmd/hclspecsuite/traversals.go index 8a8a9443..951c8685 100644 --- a/cmd/hclspecsuite/traversals.go +++ b/cmd/hclspecsuite/traversals.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func findTraversalSpec(got hcl.Traversal, candidates []*TestFileExpectTraversal) *TestFileExpectTraversal { diff --git a/ext/customdecode/customdecode.go b/ext/customdecode/customdecode.go index e0dda0df..2154b2a0 100644 --- a/ext/customdecode/customdecode.go +++ b/ext/customdecode/customdecode.go @@ -10,7 +10,7 @@ package customdecode import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/customdecode/expression_type.go b/ext/customdecode/expression_type.go index 2477f219..129f6e7c 100644 --- a/ext/customdecode/expression_type.go +++ b/ext/customdecode/expression_type.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/expand_body.go b/ext/dynblock/expand_body.go index 2cafae5f..48123909 100644 --- a/ext/dynblock/expand_body.go +++ b/ext/dynblock/expand_body.go @@ -6,7 +6,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/expand_body_test.go b/ext/dynblock/expand_body_test.go index 0941f291..6f634aec 100644 --- a/ext/dynblock/expand_body_test.go +++ b/ext/dynblock/expand_body_test.go @@ -9,9 +9,9 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/hcl/v2/hcltest" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2/hcltest" "github.com/zclconf/go-cty-debug/ctydebug" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/expand_spec.go b/ext/dynblock/expand_spec.go index 55a69ba9..aae9f726 100644 --- a/ext/dynblock/expand_spec.go +++ b/ext/dynblock/expand_spec.go @@ -6,7 +6,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/ext/dynblock/expr_wrap.go b/ext/dynblock/expr_wrap.go index 57636411..25481790 100644 --- a/ext/dynblock/expr_wrap.go +++ b/ext/dynblock/expr_wrap.go @@ -4,7 +4,7 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/iteration.go b/ext/dynblock/iteration.go index 9e811a48..fea05c04 100644 --- a/ext/dynblock/iteration.go +++ b/ext/dynblock/iteration.go @@ -4,7 +4,7 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/options.go b/ext/dynblock/options.go index 82d85865..a100773c 100644 --- a/ext/dynblock/options.go +++ b/ext/dynblock/options.go @@ -4,7 +4,7 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/public.go b/ext/dynblock/public.go index 79b6144c..b58c5217 100644 --- a/ext/dynblock/public.go +++ b/ext/dynblock/public.go @@ -7,7 +7,7 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Expand "dynamic" blocks in the given body, returning a new body that diff --git a/ext/dynblock/schema.go b/ext/dynblock/schema.go index 026008bd..dd088970 100644 --- a/ext/dynblock/schema.go +++ b/ext/dynblock/schema.go @@ -3,7 +3,7 @@ package dynblock -import "github.com/hashicorp/hcl/v2" +import "github.com/terramate-io/hcl/v2" var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{ Type: "dynamic", diff --git a/ext/dynblock/unknown_body.go b/ext/dynblock/unknown_body.go index b1fdfc07..6bfeed76 100644 --- a/ext/dynblock/unknown_body.go +++ b/ext/dynblock/unknown_body.go @@ -4,8 +4,8 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/variables.go b/ext/dynblock/variables.go index 1eb1f1e8..fd63b3c5 100644 --- a/ext/dynblock/variables.go +++ b/ext/dynblock/variables.go @@ -4,7 +4,7 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/dynblock/variables_hcldec.go b/ext/dynblock/variables_hcldec.go index caaf9df4..11c90494 100644 --- a/ext/dynblock/variables_hcldec.go +++ b/ext/dynblock/variables_hcldec.go @@ -4,8 +4,8 @@ package dynblock import ( - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hcldec" ) // VariablesHCLDec is a wrapper around WalkVariables that uses the given hcldec diff --git a/ext/dynblock/variables_test.go b/ext/dynblock/variables_test.go index ee8adaa9..85efad71 100644 --- a/ext/dynblock/variables_test.go +++ b/ext/dynblock/variables_test.go @@ -7,13 +7,13 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func TestVariables(t *testing.T) { diff --git a/ext/transform/error.go b/ext/transform/error.go index 38e064b8..5b418914 100644 --- a/ext/transform/error.go +++ b/ext/transform/error.go @@ -4,7 +4,7 @@ package transform import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // NewErrorBody returns a hcl.Body that returns the given diagnostics whenever diff --git a/ext/transform/transform.go b/ext/transform/transform.go index 035044e4..dc9c30f6 100644 --- a/ext/transform/transform.go +++ b/ext/transform/transform.go @@ -4,7 +4,7 @@ package transform import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Shallow is equivalent to calling transformer.TransformBody(body), and diff --git a/ext/transform/transform_test.go b/ext/transform/transform_test.go index 5d4b6667..40ee8c72 100644 --- a/ext/transform/transform_test.go +++ b/ext/transform/transform_test.go @@ -8,8 +8,8 @@ import ( "reflect" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hcltest" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hcltest" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/transform/transformer.go b/ext/transform/transformer.go index 511d0a29..a2cb25c5 100644 --- a/ext/transform/transformer.go +++ b/ext/transform/transformer.go @@ -4,7 +4,7 @@ package transform import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // A Transformer takes a given body, applies some (possibly no-op) diff --git a/ext/tryfunc/tryfunc.go b/ext/tryfunc/tryfunc.go index fa601da4..1f710862 100644 --- a/ext/tryfunc/tryfunc.go +++ b/ext/tryfunc/tryfunc.go @@ -16,8 +16,8 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/customdecode" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/ext/tryfunc/tryfunc_test.go b/ext/tryfunc/tryfunc_test.go index 7bd7af6d..feeac3ee 100644 --- a/ext/tryfunc/tryfunc_test.go +++ b/ext/tryfunc/tryfunc_test.go @@ -6,8 +6,8 @@ package tryfunc import ( "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/ext/typeexpr/get_type.go b/ext/typeexpr/get_type.go index 8535933f..d719ab49 100644 --- a/ext/typeexpr/get_type.go +++ b/ext/typeexpr/get_type.go @@ -9,7 +9,7 @@ import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) const invalidTypeSummary = "Invalid type specification" diff --git a/ext/typeexpr/get_type_test.go b/ext/typeexpr/get_type_test.go index d6f44844..c7f14043 100644 --- a/ext/typeexpr/get_type_test.go +++ b/ext/typeexpr/get_type_test.go @@ -7,14 +7,14 @@ import ( "fmt" "testing" - "github.com/hashicorp/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2/gohcl" "github.com/google/go-cmp/cmp" "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/json" ) var ( diff --git a/ext/typeexpr/public.go b/ext/typeexpr/public.go index e03631d3..7c190e4a 100644 --- a/ext/typeexpr/public.go +++ b/ext/typeexpr/public.go @@ -8,9 +8,9 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/typeexpr/type_type.go b/ext/typeexpr/type_type.go index 3ca0ba43..d62b0991 100644 --- a/ext/typeexpr/type_type.go +++ b/ext/typeexpr/type_type.go @@ -7,8 +7,8 @@ import ( "fmt" "reflect" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/customdecode" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" @@ -46,7 +46,8 @@ func TypeConstraintFromVal(v cty.Value) cty.Type { // ConvertFunc is a cty function that implements type conversions. // // Its signature is as follows: -// convert(value, type_constraint) +// +// convert(value, type_constraint) // // ...where type_constraint is a type constraint expression as defined by // typeexpr.TypeConstraint. diff --git a/ext/userfunc/decode.go b/ext/userfunc/decode.go index 3f3c533e..ca61d91f 100644 --- a/ext/userfunc/decode.go +++ b/ext/userfunc/decode.go @@ -4,7 +4,7 @@ package userfunc import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/ext/userfunc/decode_test.go b/ext/userfunc/decode_test.go index 60841b21..9bef6994 100644 --- a/ext/userfunc/decode_test.go +++ b/ext/userfunc/decode_test.go @@ -7,8 +7,8 @@ import ( "fmt" "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/ext/userfunc/public.go b/ext/userfunc/public.go index 8e6c9bfb..74b28a67 100644 --- a/ext/userfunc/public.go +++ b/ext/userfunc/public.go @@ -4,7 +4,7 @@ package userfunc import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty/function" ) diff --git a/fuzz/oss_fuzz_build.sh b/fuzz/oss_fuzz_build.sh index cc159a71..74ca9682 100755 --- a/fuzz/oss_fuzz_build.sh +++ b/fuzz/oss_fuzz_build.sh @@ -16,7 +16,7 @@ ################################################################################ FUZZERS_BASE=$SRC/hcl/hclsyntax/fuzz -FUZZERS_PACKAGE=github.com/hashicorp/hcl/v2/hclsyntax/fuzz +FUZZERS_PACKAGE=github.com/terramate-io/hcl/v2/hclsyntax/fuzz FUZZER_CLASS=Fuzz for THE_FUZZER in config expr template traversal diff --git a/go.mod b/go.mod index 56c414fa..785f704c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/hashicorp/hcl/v2 +module github.com/terramate-io/hcl/v2 go 1.18 diff --git a/gohcl/decode.go b/gohcl/decode.go index 2d1776a3..2e3b1dde 100644 --- a/gohcl/decode.go +++ b/gohcl/decode.go @@ -9,7 +9,7 @@ import ( "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/gohcl/decode_test.go b/gohcl/decode_test.go index 1ac5d049..02f7cacd 100644 --- a/gohcl/decode_test.go +++ b/gohcl/decode_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2" - hclJSON "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2" + hclJSON "github.com/terramate-io/hcl/v2/json" "github.com/zclconf/go-cty/cty" ) diff --git a/gohcl/encode.go b/gohcl/encode.go index 64cb2d1e..ecd73c93 100644 --- a/gohcl/encode.go +++ b/gohcl/encode.go @@ -8,7 +8,7 @@ import ( "reflect" "sort" - "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/terramate-io/hcl/v2/hclwrite" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/gohcl/encode_test.go b/gohcl/encode_test.go index a75bf28b..a70f2033 100644 --- a/gohcl/encode_test.go +++ b/gohcl/encode_test.go @@ -6,8 +6,8 @@ package gohcl_test import ( "fmt" - "github.com/hashicorp/hcl/v2/gohcl" - "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/terramate-io/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2/hclwrite" ) func ExampleEncodeIntoBody() { diff --git a/gohcl/schema.go b/gohcl/schema.go index 0cdca271..98b994aa 100644 --- a/gohcl/schema.go +++ b/gohcl/schema.go @@ -9,7 +9,7 @@ import ( "sort" "strings" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // ImpliedBodySchema produces a hcl.BodySchema derived from the type of the diff --git a/gohcl/schema_test.go b/gohcl/schema_test.go index ca8c0ec1..f541dc0e 100644 --- a/gohcl/schema_test.go +++ b/gohcl/schema_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestImpliedBodySchema(t *testing.T) { diff --git a/gohcl/types.go b/gohcl/types.go index 302e454c..aca14c54 100644 --- a/gohcl/types.go +++ b/gohcl/types.go @@ -6,7 +6,7 @@ package gohcl import ( "reflect" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) var victimExpr hcl.Expression diff --git a/guide/go_decoding_gohcl.rst b/guide/go_decoding_gohcl.rst index 7ef21260..66f1e821 100644 --- a/guide/go_decoding_gohcl.rst +++ b/guide/go_decoding_gohcl.rst @@ -53,7 +53,7 @@ which case ``nil`` is written to indicate the absense of the argument. The sections below discuss some additional decoding use-cases. For full details on the `gohcl` package, see -`the godoc reference `_. +`the godoc reference `_. .. _go-decoding-gohcl-evalcontext: diff --git a/guide/go_decoding_hcldec.rst b/guide/go_decoding_hcldec.rst index f05b9269..c40f9666 100644 --- a/guide/go_decoding_hcldec.rst +++ b/guide/go_decoding_hcldec.rst @@ -22,7 +22,7 @@ dynamically-typed data structures. The sections below are an overview of the main parts of package ``hcldec``. For full details, see -`the package godoc `_. +`the package godoc `_. .. _`HashiCorp Terraform`: https://www.terraform.io/ diff --git a/guide/go_decoding_lowlevel.rst b/guide/go_decoding_lowlevel.rst index e0b5e997..689be18c 100644 --- a/guide/go_decoding_lowlevel.rst +++ b/guide/go_decoding_lowlevel.rst @@ -34,7 +34,7 @@ to the more detailed information where needed while using the higher-level APIs for the more straightforward portions of a configuration language. The following subsections will give an overview of the low-level API. For full -details, see `the godoc reference `_. +details, see `the godoc reference `_. Structural Decoding ------------------- diff --git a/guide/go_parsing.rst b/guide/go_parsing.rst index 77345fce..ef85839f 100644 --- a/guide/go_parsing.rst +++ b/guide/go_parsing.rst @@ -61,4 +61,4 @@ Package ``hclparse`` The above list just highlights the main functions in this package. For full documentation, see -`the hclparse godoc `_. +`the hclparse godoc `_. diff --git a/hcldec/block_labels.go b/hcldec/block_labels.go index 9e6f1f2c..07d7a521 100644 --- a/hcldec/block_labels.go +++ b/hcldec/block_labels.go @@ -4,7 +4,7 @@ package hcldec import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type blockLabel struct { diff --git a/hcldec/decode.go b/hcldec/decode.go index 5f86e67f..ad2feaaa 100644 --- a/hcldec/decode.go +++ b/hcldec/decode.go @@ -4,7 +4,7 @@ package hcldec import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hcldec/public.go b/hcldec/public.go index ff1e5fe9..62df1c62 100644 --- a/hcldec/public.go +++ b/hcldec/public.go @@ -4,7 +4,7 @@ package hcldec import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hcldec/public_test.go b/hcldec/public_test.go index 0087c051..b5e74fff 100644 --- a/hcldec/public_test.go +++ b/hcldec/public_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hcldec/schema.go b/hcldec/schema.go index 8a9fa4fe..ca5d45ac 100644 --- a/hcldec/schema.go +++ b/hcldec/schema.go @@ -4,7 +4,7 @@ package hcldec import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // ImpliedSchema returns the *hcl.BodySchema implied by the given specification. diff --git a/hcldec/spec.go b/hcldec/spec.go index b07a5534..b50cd305 100644 --- a/hcldec/spec.go +++ b/hcldec/spec.go @@ -8,8 +8,8 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/customdecode" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/hcldec/spec_test.go b/hcldec/spec_test.go index a88066b5..b309ddb0 100644 --- a/hcldec/spec_test.go +++ b/hcldec/spec_test.go @@ -13,8 +13,8 @@ import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) // Verify that all of our spec types implement the necessary interfaces diff --git a/hcldec/variables.go b/hcldec/variables.go index c5ac1744..e64813b5 100644 --- a/hcldec/variables.go +++ b/hcldec/variables.go @@ -4,7 +4,7 @@ package hcldec import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Variables processes the given body with the given spec and returns a diff --git a/hcldec/variables_test.go b/hcldec/variables_test.go index 10412deb..5436a97c 100644 --- a/hcldec/variables_test.go +++ b/hcldec/variables_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hcled/navigation.go b/hcled/navigation.go index 85935696..9ca12a13 100644 --- a/hcled/navigation.go +++ b/hcled/navigation.go @@ -4,7 +4,7 @@ package hcled import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type contextStringer interface { diff --git a/hclparse/parser.go b/hclparse/parser.go index c9b843d0..4b2fd9b5 100644 --- a/hclparse/parser.go +++ b/hclparse/parser.go @@ -19,9 +19,9 @@ import ( "fmt" "io/ioutil" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/json" ) // NOTE: This is the public interface for parsing. The actual parsers are diff --git a/hclsimple/hclsimple.go b/hclsimple/hclsimple.go index a3ba45c2..b1b95718 100644 --- a/hclsimple/hclsimple.go +++ b/hclsimple/hclsimple.go @@ -15,10 +15,10 @@ import ( "path/filepath" "strings" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/gohcl" - "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/json" ) // Decode parses, decodes, and evaluates expressions in the given HCL source diff --git a/hclsimple/hclsimple_test.go b/hclsimple/hclsimple_test.go index 034edd53..43301ccb 100644 --- a/hclsimple/hclsimple_test.go +++ b/hclsimple/hclsimple_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2/hclsimple" + "github.com/terramate-io/hcl/v2/hclsimple" ) func Example_nativeSyntax() { diff --git a/hclsyntax/diagnostics.go b/hclsyntax/diagnostics.go index 43689d74..b8ecfffd 100644 --- a/hclsyntax/diagnostics.go +++ b/hclsyntax/diagnostics.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // setDiagEvalContext is an internal helper that will impose a particular diff --git a/hclsyntax/expression.go b/hclsyntax/expression.go index 577a50fa..6a4def0d 100644 --- a/hclsyntax/expression.go +++ b/hclsyntax/expression.go @@ -9,8 +9,8 @@ import ( "strings" "sync" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/customdecode" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/hclsyntax/expression_ops.go b/hclsyntax/expression_ops.go index 6585612c..2d8e67af 100644 --- a/hclsyntax/expression_ops.go +++ b/hclsyntax/expression_ops.go @@ -6,7 +6,7 @@ package hclsyntax import ( "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/hclsyntax/expression_static_test.go b/hclsyntax/expression_static_test.go index 9b23b727..c4e3126b 100644 --- a/hclsyntax/expression_static_test.go +++ b/hclsyntax/expression_static_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/go-test/deep" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/expression_template.go b/hclsyntax/expression_template.go index a0dc7c22..a630c22c 100644 --- a/hclsyntax/expression_template.go +++ b/hclsyntax/expression_template.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/hclsyntax/expression_template_test.go b/hclsyntax/expression_template_test.go index 31198458..769de003 100644 --- a/hclsyntax/expression_template_test.go +++ b/hclsyntax/expression_template_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/expression_test.go b/hclsyntax/expression_test.go index b50dc137..9c33d3d0 100644 --- a/hclsyntax/expression_test.go +++ b/hclsyntax/expression_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/function/stdlib" diff --git a/hclsyntax/expression_typeparams_test.go b/hclsyntax/expression_typeparams_test.go index c7fdbd22..c4ee4654 100644 --- a/hclsyntax/expression_typeparams_test.go +++ b/hclsyntax/expression_typeparams_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/hclsyntax/expression_vars.go b/hclsyntax/expression_vars.go index 6c3e472c..e7c4977f 100755 --- a/hclsyntax/expression_vars.go +++ b/hclsyntax/expression_vars.go @@ -7,7 +7,7 @@ package hclsyntax // Run 'go generate' on this package to update the set of functions here. import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func (e *AnonSymbolExpr) Variables() []hcl.Traversal { diff --git a/hclsyntax/expression_vars_gen.go b/hclsyntax/expression_vars_gen.go index d0888025..efcc1ca4 100644 --- a/hclsyntax/expression_vars_gen.go +++ b/hclsyntax/expression_vars_gen.go @@ -96,7 +96,7 @@ package hclsyntax // Run 'go generate' on this package to update the set of functions here. import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" )` const outputMethodFmt = ` diff --git a/hclsyntax/file.go b/hclsyntax/file.go index 7be626ff..75d950da 100644 --- a/hclsyntax/file.go +++ b/hclsyntax/file.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // File is the top-level object resulting from parsing a configuration file. diff --git a/hclsyntax/fuzz/Makefile b/hclsyntax/fuzz/Makefile index ca44fa22..2882459e 100644 --- a/hclsyntax/fuzz/Makefile +++ b/hclsyntax/fuzz/Makefile @@ -15,7 +15,7 @@ fuzz-exec-%: fuzz%-fuzz.zip go-fuzz -bin=./fuzz$*-fuzz.zip -workdir=$(FUZZ_WORK_DIR) fuzz%-fuzz.zip: %/fuzz.go - go-fuzz-build github.com/hashicorp/hcl/v2/hclsyntax/fuzz/$* + go-fuzz-build github.com/terramate-io/hcl/v2/hclsyntax/fuzz/$* tools: go get -u github.com/dvyukov/go-fuzz/go-fuzz diff --git a/hclsyntax/fuzz/fuzz_test.go b/hclsyntax/fuzz/fuzz_test.go index 4aaee5d0..3b5145f2 100644 --- a/hclsyntax/fuzz/fuzz_test.go +++ b/hclsyntax/fuzz/fuzz_test.go @@ -6,8 +6,8 @@ package fuzzhclsyntax import ( "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func FuzzParseTemplate(f *testing.F) { diff --git a/hclsyntax/navigation.go b/hclsyntax/navigation.go index 83e1d4ef..e922e234 100644 --- a/hclsyntax/navigation.go +++ b/hclsyntax/navigation.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type navigation struct { diff --git a/hclsyntax/navigation_test.go b/hclsyntax/navigation_test.go index 12187398..28366c6e 100644 --- a/hclsyntax/navigation_test.go +++ b/hclsyntax/navigation_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestNavigationContextString(t *testing.T) { diff --git a/hclsyntax/node.go b/hclsyntax/node.go index 6ead6091..01c01192 100644 --- a/hclsyntax/node.go +++ b/hclsyntax/node.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Node is the abstract type that every AST node implements. diff --git a/hclsyntax/parse_traversal_test.go b/hclsyntax/parse_traversal_test.go index 5d8d24ea..f6582655 100644 --- a/hclsyntax/parse_traversal_test.go +++ b/hclsyntax/parse_traversal_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-test/deep" "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestParseTraversalAbs(t *testing.T) { diff --git a/hclsyntax/parser.go b/hclsyntax/parser.go index fec7861a..b49223ce 100644 --- a/hclsyntax/parser.go +++ b/hclsyntax/parser.go @@ -10,7 +10,7 @@ import ( "unicode/utf8" "github.com/apparentlymart/go-textseg/v15/textseg" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/parser_template.go b/hclsyntax/parser_template.go index 19e98806..f5b8b6a6 100644 --- a/hclsyntax/parser_template.go +++ b/hclsyntax/parser_template.go @@ -9,7 +9,7 @@ import ( "unicode" "github.com/apparentlymart/go-textseg/v15/textseg" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/parser_test.go b/hclsyntax/parser_test.go index 66f1308f..8655dbdf 100644 --- a/hclsyntax/parser_test.go +++ b/hclsyntax/parser_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty-debug/ctydebug" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/parser_traversal.go b/hclsyntax/parser_traversal.go index f7d4062f..b867602e 100644 --- a/hclsyntax/parser_traversal.go +++ b/hclsyntax/parser_traversal.go @@ -6,7 +6,7 @@ package hclsyntax import ( "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // ParseTraversalAbs parses an absolute traversal that is assumed to consume diff --git a/hclsyntax/peeker.go b/hclsyntax/peeker.go index 74fa3fb3..7b5038da 100644 --- a/hclsyntax/peeker.go +++ b/hclsyntax/peeker.go @@ -10,7 +10,7 @@ import ( "runtime" "strings" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // This is set to true at init() time in tests, to enable more useful output diff --git a/hclsyntax/public.go b/hclsyntax/public.go index 17dc1ed4..3227c7df 100644 --- a/hclsyntax/public.go +++ b/hclsyntax/public.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // ParseConfig parses the given buffer as a whole HCL config file, returning diff --git a/hclsyntax/public_test.go b/hclsyntax/public_test.go index 6cdd3b17..95f1d043 100644 --- a/hclsyntax/public_test.go +++ b/hclsyntax/public_test.go @@ -6,7 +6,7 @@ package hclsyntax import ( "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestValidIdentifier(t *testing.T) { diff --git a/hclsyntax/scan_tokens.go b/hclsyntax/scan_tokens.go index 3ed8455f..7df382c0 100644 --- a/hclsyntax/scan_tokens.go +++ b/hclsyntax/scan_tokens.go @@ -7,7 +7,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/hclsyntax/scan_tokens.rl b/hclsyntax/scan_tokens.rl index 66bb4714..b699ee88 100644 --- a/hclsyntax/scan_tokens.rl +++ b/hclsyntax/scan_tokens.rl @@ -6,7 +6,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/hclsyntax/scan_tokens_test.go b/hclsyntax/scan_tokens_test.go index 10c42007..365cfad6 100644 --- a/hclsyntax/scan_tokens_test.go +++ b/hclsyntax/scan_tokens_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestScanTokens_normal(t *testing.T) { diff --git a/hclsyntax/structure.go b/hclsyntax/structure.go index ff272631..6274cc21 100644 --- a/hclsyntax/structure.go +++ b/hclsyntax/structure.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // AsHCLBlock returns the block data expressed as a *hcl.Block. diff --git a/hclsyntax/structure_at_pos.go b/hclsyntax/structure_at_pos.go index 50857168..c7ecf13a 100644 --- a/hclsyntax/structure_at_pos.go +++ b/hclsyntax/structure_at_pos.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // ----------------------------------------------------------------------------- diff --git a/hclsyntax/structure_at_pos_test.go b/hclsyntax/structure_at_pos_test.go index 052a938a..0778cf40 100644 --- a/hclsyntax/structure_at_pos_test.go +++ b/hclsyntax/structure_at_pos_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestBlocksAtPos(t *testing.T) { diff --git a/hclsyntax/structure_test.go b/hclsyntax/structure_test.go index 180425bf..e21e08f6 100644 --- a/hclsyntax/structure_test.go +++ b/hclsyntax/structure_test.go @@ -10,7 +10,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty-debug/ctydebug" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/token.go b/hclsyntax/token.go index 47648b8f..7f22132b 100644 --- a/hclsyntax/token.go +++ b/hclsyntax/token.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/apparentlymart/go-textseg/v15/textseg" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Token represents a sequence of bytes from some HCL code that has been diff --git a/hclsyntax/token_test.go b/hclsyntax/token_test.go index 2ce05479..d0ad0c53 100644 --- a/hclsyntax/token_test.go +++ b/hclsyntax/token_test.go @@ -6,7 +6,7 @@ package hclsyntax import ( "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestCheckInvalidTokensTest(t *testing.T) { diff --git a/hclsyntax/variables.go b/hclsyntax/variables.go index b4be9269..77410a2f 100644 --- a/hclsyntax/variables.go +++ b/hclsyntax/variables.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Variables returns all of the variables referenced within a given experssion. diff --git a/hclsyntax/variables_test.go b/hclsyntax/variables_test.go index 9eb3d411..2f825911 100644 --- a/hclsyntax/variables_test.go +++ b/hclsyntax/variables_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/walk.go b/hclsyntax/walk.go index 82b6f9b0..39461e5e 100644 --- a/hclsyntax/walk.go +++ b/hclsyntax/walk.go @@ -4,7 +4,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // VisitFunc is the callback signature for VisitAll. diff --git a/hclsyntax/walk_test.go b/hclsyntax/walk_test.go index 5ac0ca88..1dcdda3e 100644 --- a/hclsyntax/walk_test.go +++ b/hclsyntax/walk_test.go @@ -11,7 +11,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/go-test/deep" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestWalk(t *testing.T) { diff --git a/hcltest/mock.go b/hcltest/mock.go index 9df3e8d1..49f3411d 100644 --- a/hcltest/mock.go +++ b/hcltest/mock.go @@ -6,9 +6,9 @@ package hcltest import ( "fmt" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hcltest/mock_test.go b/hcltest/mock_test.go index eb0e6db1..3823edc1 100644 --- a/hcltest/mock_test.go +++ b/hcltest/mock_test.go @@ -9,7 +9,7 @@ import ( "reflect" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/ast_attribute.go b/hclwrite/ast_attribute.go index 3edc68c0..8e2348da 100644 --- a/hclwrite/ast_attribute.go +++ b/hclwrite/ast_attribute.go @@ -4,7 +4,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" ) type Attribute struct { diff --git a/hclwrite/ast_block.go b/hclwrite/ast_block.go index 91e7d4a3..af1ab597 100644 --- a/hclwrite/ast_block.go +++ b/hclwrite/ast_block.go @@ -4,7 +4,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/ast_block_test.go b/hclwrite/ast_block_test.go index 0760001a..f8ce2aca 100644 --- a/hclwrite/ast_block_test.go +++ b/hclwrite/ast_block_test.go @@ -11,8 +11,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func TestBlockType(t *testing.T) { diff --git a/hclwrite/ast_body.go b/hclwrite/ast_body.go index 6321509a..8387456f 100644 --- a/hclwrite/ast_body.go +++ b/hclwrite/ast_body.go @@ -6,8 +6,8 @@ package hclwrite import ( "reflect" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/ast_body_test.go b/hclwrite/ast_body_test.go index 1e235234..d70f9c4f 100644 --- a/hclwrite/ast_body_test.go +++ b/hclwrite/ast_body_test.go @@ -11,8 +11,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/ast_expression.go b/hclwrite/ast_expression.go index 77b9f780..a1baf773 100644 --- a/hclwrite/ast_expression.go +++ b/hclwrite/ast_expression.go @@ -6,8 +6,8 @@ package hclwrite import ( "fmt" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/examples_test.go b/hclwrite/examples_test.go index f61d7827..525225db 100644 --- a/hclwrite/examples_test.go +++ b/hclwrite/examples_test.go @@ -6,8 +6,8 @@ package hclwrite_test import ( "fmt" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclwrite" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/format.go b/hclwrite/format.go index c9722dd2..3d3179a4 100644 --- a/hclwrite/format.go +++ b/hclwrite/format.go @@ -4,7 +4,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" ) // format rewrites tokens within the given sequence, in-place, to adjust the diff --git a/hclwrite/format_test.go b/hclwrite/format_test.go index 5c4eb7a6..02f5bf6c 100644 --- a/hclwrite/format_test.go +++ b/hclwrite/format_test.go @@ -10,7 +10,7 @@ import ( "reflect" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func TestFormat(t *testing.T) { diff --git a/hclwrite/fuzz/Makefile b/hclwrite/fuzz/Makefile index e303748e..4bf5c79b 100644 --- a/hclwrite/fuzz/Makefile +++ b/hclwrite/fuzz/Makefile @@ -12,7 +12,7 @@ fuzz-exec-%: fuzz%-fuzz.zip go-fuzz -bin=./fuzz$*-fuzz.zip -workdir=$(FUZZ_WORK_DIR) fuzz%-fuzz.zip: %/fuzz.go - go-fuzz-build -x github.com/hashicorp/hcl/v2/hclwrite/fuzz/$* + go-fuzz-build -x github.com/terramate-io/hcl/v2/hclwrite/fuzz/$* tools: go get -u github.com/dvyukov/go-fuzz/go-fuzz diff --git a/hclwrite/fuzz/fuzz_test.go b/hclwrite/fuzz/fuzz_test.go index 573741c7..7856592e 100644 --- a/hclwrite/fuzz/fuzz_test.go +++ b/hclwrite/fuzz/fuzz_test.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclwrite" ) func FuzzParseConfig(f *testing.F) { diff --git a/hclwrite/generate.go b/hclwrite/generate.go index 678d5391..c169b51e 100644 --- a/hclwrite/generate.go +++ b/hclwrite/generate.go @@ -8,8 +8,8 @@ import ( "unicode" "unicode/utf8" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/generate_test.go b/hclwrite/generate_test.go index 87dffeca..242735c7 100644 --- a/hclwrite/generate_test.go +++ b/hclwrite/generate_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/hclwrite/native_node_sorter.go b/hclwrite/native_node_sorter.go index 0a78683b..080a1c1e 100644 --- a/hclwrite/native_node_sorter.go +++ b/hclwrite/native_node_sorter.go @@ -4,7 +4,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/hclsyntax" ) type nativeNodeSorter struct { diff --git a/hclwrite/parser.go b/hclwrite/parser.go index 53415aeb..7d087553 100644 --- a/hclwrite/parser.go +++ b/hclwrite/parser.go @@ -7,8 +7,8 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) @@ -521,10 +521,10 @@ func writerTokens(nativeTokens hclsyntax.Tokens) Tokens { // boundaries, such that the slice operator could be used to produce // three token sequences for before, within, and after respectively: // -// start, end := partitionTokens(toks, rng) -// before := toks[:start] -// within := toks[start:end] -// after := toks[end:] +// start, end := partitionTokens(toks, rng) +// before := toks[:start] +// within := toks[start:end] +// after := toks[end:] // // This works best when the range is aligned with token boundaries (e.g. // because it was produced in terms of the scanner's result) but if that isn't diff --git a/hclwrite/parser_test.go b/hclwrite/parser_test.go index 8ccae993..565b5917 100644 --- a/hclwrite/parser_test.go +++ b/hclwrite/parser_test.go @@ -10,8 +10,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func TestParse(t *testing.T) { diff --git a/hclwrite/public.go b/hclwrite/public.go index 8003a71d..51fd38ba 100644 --- a/hclwrite/public.go +++ b/hclwrite/public.go @@ -6,7 +6,7 @@ package hclwrite import ( "bytes" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // NewFile creates a new file object that is empty and ready to have constructs diff --git a/hclwrite/round_trip_test.go b/hclwrite/round_trip_test.go index 9dbb1526..76e70840 100644 --- a/hclwrite/round_trip_test.go +++ b/hclwrite/round_trip_test.go @@ -12,8 +12,8 @@ import ( "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/function/stdlib" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) func TestRoundTripVerbatim(t *testing.T) { diff --git a/hclwrite/tokens.go b/hclwrite/tokens.go index 7b6fddce..21ab05ce 100644 --- a/hclwrite/tokens.go +++ b/hclwrite/tokens.go @@ -8,8 +8,8 @@ import ( "io" "github.com/apparentlymart/go-textseg/v15/textseg" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" ) // Token is a single sequence of bytes annotated with a type. It is similar diff --git a/integrationtest/convertfunc_test.go b/integrationtest/convertfunc_test.go index 0dc2adde..919b2ba6 100644 --- a/integrationtest/convertfunc_test.go +++ b/integrationtest/convertfunc_test.go @@ -6,9 +6,9 @@ package integrationtest import ( "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/typeexpr" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/typeexpr" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/integrationtest/hcldec_into_expr_test.go b/integrationtest/hcldec_into_expr_test.go index 9b00f3bd..11967694 100644 --- a/integrationtest/hcldec_into_expr_test.go +++ b/integrationtest/hcldec_into_expr_test.go @@ -8,10 +8,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/customdecode" - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/customdecode" + "github.com/terramate-io/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/integrationtest/terraformlike_test.go b/integrationtest/terraformlike_test.go index ae866269..e6c5326c 100644 --- a/integrationtest/terraformlike_test.go +++ b/integrationtest/terraformlike_test.go @@ -9,12 +9,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/ext/dynblock" - "github.com/hashicorp/hcl/v2/gohcl" - "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/ext/dynblock" + "github.com/terramate-io/hcl/v2/gohcl" + "github.com/terramate-io/hcl/v2/hcldec" + "github.com/terramate-io/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2/json" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) diff --git a/json/ast.go b/json/ast.go index 3b385cce..1d9a754e 100644 --- a/json/ast.go +++ b/json/ast.go @@ -6,7 +6,7 @@ package json import ( "math/big" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) type node interface { diff --git a/json/fuzz/Makefile b/json/fuzz/Makefile index 5897a665..39299eae 100644 --- a/json/fuzz/Makefile +++ b/json/fuzz/Makefile @@ -12,7 +12,7 @@ fuzz-exec-%: fuzz%-fuzz.zip go-fuzz -bin=./fuzz$*-fuzz.zip -workdir=$(FUZZ_WORK_DIR) fuzz%-fuzz.zip: %/fuzz.go - go-fuzz-build github.com/hashicorp/hcl/v2/json/fuzz/$* + go-fuzz-build github.com/terramate-io/hcl/v2/json/fuzz/$* tools: go get -u github.com/dvyukov/go-fuzz/go-fuzz diff --git a/json/fuzz/fuzz_test.go b/json/fuzz/fuzz_test.go index ccc21184..c1b9fbed 100644 --- a/json/fuzz/fuzz_test.go +++ b/json/fuzz/fuzz_test.go @@ -6,7 +6,7 @@ package fuzzjson import ( "testing" - "github.com/hashicorp/hcl/v2/json" + "github.com/terramate-io/hcl/v2/json" ) func FuzzParse(f *testing.F) { diff --git a/json/is.go b/json/is.go index 1d1a0b18..1428ba37 100644 --- a/json/is.go +++ b/json/is.go @@ -4,7 +4,7 @@ package json import ( - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // IsJSONExpression returns true if and only if the given expression is one diff --git a/json/parser.go b/json/parser.go index 6b9bbf3e..539e1fa5 100644 --- a/json/parser.go +++ b/json/parser.go @@ -7,7 +7,7 @@ import ( "encoding/json" "fmt" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/json/parser_test.go b/json/parser_test.go index 8f77630d..0bc52abe 100644 --- a/json/parser_test.go +++ b/json/parser_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/go-test/deep" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func init() { diff --git a/json/public.go b/json/public.go index f36e52c8..e67a6d47 100644 --- a/json/public.go +++ b/json/public.go @@ -8,7 +8,7 @@ import ( "io/ioutil" "os" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) // Parse attempts to parse the given buffer as JSON and, if successful, returns diff --git a/json/public_test.go b/json/public_test.go index 6ecf40fa..a46f3fc0 100644 --- a/json/public_test.go +++ b/json/public_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/json/scanner.go b/json/scanner.go index a5e21305..ea3f1067 100644 --- a/json/scanner.go +++ b/json/scanner.go @@ -7,7 +7,7 @@ import ( "fmt" "github.com/apparentlymart/go-textseg/v15/textseg" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) //go:generate go run golang.org/x/tools/cmd/stringer -type tokenType scanner.go diff --git a/json/scanner_test.go b/json/scanner_test.go index d59c201e..9165a3f4 100644 --- a/json/scanner_test.go +++ b/json/scanner_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" ) func TestScan(t *testing.T) { diff --git a/json/structure.go b/json/structure.go index 3b7c425c..8fce12a2 100644 --- a/json/structure.go +++ b/json/structure.go @@ -6,8 +6,8 @@ package json import ( "fmt" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/terramate-io/hcl/v2" + "github.com/terramate-io/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/json/structure_test.go b/json/structure_test.go index bf6be2f2..24438d4e 100644 --- a/json/structure_test.go +++ b/json/structure_test.go @@ -11,7 +11,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/go-test/deep" - "github.com/hashicorp/hcl/v2" + "github.com/terramate-io/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/specsuite/spec_test.go b/specsuite/spec_test.go index 36360a64..60b22549 100644 --- a/specsuite/spec_test.go +++ b/specsuite/spec_test.go @@ -31,12 +31,12 @@ func TestMain(m *testing.M) { } func build() error { - err := goBuild("github.com/hashicorp/hcl/v2/cmd/hcldec", "tmp_hcldec") + err := goBuild("github.com/terramate-io/hcl/v2/cmd/hcldec", "tmp_hcldec") if err != nil { return fmt.Errorf("error building hcldec: %s", err) } - err = goBuild("github.com/hashicorp/hcl/v2/cmd/hclspecsuite", "tmp_hclspecsuite") + err = goBuild("github.com/terramate-io/hcl/v2/cmd/hclspecsuite", "tmp_hclspecsuite") if err != nil { return fmt.Errorf("error building hcldec: %s", err) }