diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-16 05:37:14 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-16 08:37:14 -0400 |
commit | 6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch) | |
tree | 3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/hashicorp/hcl/hcl/printer | |
parent | bf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff) | |
download | chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2 chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip |
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/hcl/printer')
39 files changed, 100 insertions, 877 deletions
diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go b/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go index c896d5844..7c038d12a 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go @@ -252,6 +252,14 @@ func (p *printer) objectItem(o *ast.ObjectItem) []byte { } } + // If key and val are on different lines, treat line comments like lead comments. + if o.LineComment != nil && o.Val.Pos().Line != o.Keys[0].Pos().Line { + for _, comment := range o.LineComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + for i, k := range o.Keys { buf.WriteString(k.Token.Text) buf.WriteByte(blank) @@ -265,7 +273,7 @@ func (p *printer) objectItem(o *ast.ObjectItem) []byte { buf.Write(p.output(o.Val)) - if o.Val.Pos().Line == o.Keys[0].Pos().Line && o.LineComment != nil { + if o.LineComment != nil && o.Val.Pos().Line == o.Keys[0].Pos().Line { buf.WriteByte(blank) for _, comment := range o.LineComment.List { buf.WriteString(comment.Text) @@ -509,8 +517,13 @@ func (p *printer) alignedItems(items []*ast.ObjectItem) []byte { // list returns the printable HCL form of an list type. func (p *printer) list(l *ast.ListType) []byte { + if p.isSingleLineList(l) { + return p.singleLineList(l) + } + var buf bytes.Buffer buf.WriteString("[") + buf.WriteByte(newline) var longestLine int for _, item := range l.List { @@ -523,115 +536,112 @@ func (p *printer) list(l *ast.ListType) []byte { } } - insertSpaceBeforeItem := false - lastHadLeadComment := false + haveEmptyLine := false for i, item := range l.List { - // Keep track of whether this item is a heredoc since that has - // unique behavior. - heredoc := false - if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { - heredoc = true - } - - if item.Pos().Line != l.Lbrack.Line { - // multiline list, add newline before we add each item - buf.WriteByte(newline) - insertSpaceBeforeItem = false - - // If we have a lead comment, then we want to write that first - leadComment := false - if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { - leadComment = true - - // If this isn't the first item and the previous element - // didn't have a lead comment, then we need to add an extra - // newline to properly space things out. If it did have a - // lead comment previously then this would be done - // automatically. - if i > 0 && !lastHadLeadComment { - buf.WriteByte(newline) - } - - for _, comment := range lit.LeadComment.List { - buf.Write(p.indent([]byte(comment.Text))) - buf.WriteByte(newline) - } + // If we have a lead comment, then we want to write that first + leadComment := false + if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { + leadComment = true + + // Ensure an empty line before every element with a + // lead comment (except the first item in a list). + if !haveEmptyLine && i != 0 { + buf.WriteByte(newline) } - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(p.indent(val)) - - // if this item is a heredoc, then we output the comma on - // the next line. This is the only case this happens. - comma := []byte{','} - if heredoc { + for _, comment := range lit.LeadComment.List { + buf.Write(p.indent([]byte(comment.Text))) buf.WriteByte(newline) - comma = p.indent(comma) } + } - buf.Write(comma) + // also indent each line + val := p.output(item) + curLen := len(val) + buf.Write(p.indent(val)) - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } + // if this item is a heredoc, then we output the comma on + // the next line. This is the only case this happens. + comma := []byte{','} + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + comma = p.indent(comma) + } - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } + buf.Write(comma) - lastItem := i == len(l.List)-1 - if lastItem { - buf.WriteByte(newline) + if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { + // if the next item doesn't have any comments, do not align + buf.WriteByte(blank) // align one space + for i := 0; i < longestLine-curLen; i++ { + buf.WriteByte(blank) } - if leadComment && !lastItem { - buf.WriteByte(newline) + for _, comment := range lit.LineComment.List { + buf.WriteString(comment.Text) } + } - lastHadLeadComment = leadComment - } else { - if insertSpaceBeforeItem { - buf.WriteByte(blank) - insertSpaceBeforeItem = false - } + buf.WriteByte(newline) - // Output the item itself - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(val) + // Ensure an empty line after every element with a + // lead comment (except the first item in a list). + haveEmptyLine = leadComment && i != len(l.List)-1 + if haveEmptyLine { + buf.WriteByte(newline) + } + } - // If this is a heredoc item we always have to output a newline - // so that it parses properly. - if heredoc { - buf.WriteByte(newline) - } + buf.WriteString("]") + return buf.Bytes() +} - // If this isn't the last element, write a comma. - if i != len(l.List)-1 { - buf.WriteString(",") - insertSpaceBeforeItem = true - } +// isSingleLineList returns true if: +// * they were previously formatted entirely on one line +// * they consist entirely of literals +// * there are either no heredoc strings or the list has exactly one element +// * there are no line comments +func (printer) isSingleLineList(l *ast.ListType) bool { + for _, item := range l.List { + if item.Pos().Line != l.Lbrack.Line { + return false + } - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } + lit, ok := item.(*ast.LiteralType) + if !ok { + return false + } - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } + if lit.Token.Type == token.HEREDOC && len(l.List) != 1 { + return false + } + + if lit.LineComment != nil { + return false + } + } + + return true +} + +// singleLineList prints a simple single line list. +// For a definition of "simple", see isSingleLineList above. +func (p *printer) singleLineList(l *ast.ListType) []byte { + buf := &bytes.Buffer{} + + buf.WriteString("[") + for i, item := range l.List { + if i != 0 { + buf.WriteString(", ") } + // Output the item itself + buf.Write(p.output(item)) + + // The heredoc marker needs to be at the end of line. + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + } } buf.WriteString("]") diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go b/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go deleted file mode 100644 index 5248259b9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go +++ /dev/null @@ -1,149 +0,0 @@ -package printer - -import ( - "bytes" - "errors" - "flag" - "fmt" - "io/ioutil" - "path/filepath" - "testing" - - "github.com/hashicorp/hcl/hcl/parser" -) - -var update = flag.Bool("update", false, "update golden files") - -const ( - dataDir = "testdata" -) - -type entry struct { - source, golden string -} - -// Use go test -update to create/update the respective golden files. -var data = []entry{ - {"complexhcl.input", "complexhcl.golden"}, - {"list.input", "list.golden"}, - {"list_comment.input", "list_comment.golden"}, - {"comment.input", "comment.golden"}, - {"comment_crlf.input", "comment.golden"}, - {"comment_aligned.input", "comment_aligned.golden"}, - {"comment_array.input", "comment_array.golden"}, - {"comment_end_file.input", "comment_end_file.golden"}, - {"comment_multiline_indent.input", "comment_multiline_indent.golden"}, - {"comment_multiline_no_stanza.input", "comment_multiline_no_stanza.golden"}, - {"comment_multiline_stanza.input", "comment_multiline_stanza.golden"}, - {"comment_newline.input", "comment_newline.golden"}, - {"comment_object_multi.input", "comment_object_multi.golden"}, - {"comment_standalone.input", "comment_standalone.golden"}, - {"empty_block.input", "empty_block.golden"}, - {"list_of_objects.input", "list_of_objects.golden"}, - {"multiline_string.input", "multiline_string.golden"}, - {"object_singleline.input", "object_singleline.golden"}, - {"object_with_heredoc.input", "object_with_heredoc.golden"}, -} - -func TestFiles(t *testing.T) { - for _, e := range data { - source := filepath.Join(dataDir, e.source) - golden := filepath.Join(dataDir, e.golden) - t.Run(e.source, func(t *testing.T) { - check(t, source, golden) - }) - } -} - -func check(t *testing.T, source, golden string) { - src, err := ioutil.ReadFile(source) - if err != nil { - t.Error(err) - return - } - - res, err := format(src) - if err != nil { - t.Error(err) - return - } - - // update golden files if necessary - if *update { - if err := ioutil.WriteFile(golden, res, 0644); err != nil { - t.Error(err) - } - return - } - - // get golden - gld, err := ioutil.ReadFile(golden) - if err != nil { - t.Error(err) - return - } - - // formatted source and golden must be the same - if err := diff(source, golden, res, gld); err != nil { - t.Error(err) - return - } -} - -// diff compares a and b. -func diff(aname, bname string, a, b []byte) error { - var buf bytes.Buffer // holding long error message - - // compare lengths - if len(a) != len(b) { - fmt.Fprintf(&buf, "\nlength changed: len(%s) = %d, len(%s) = %d", aname, len(a), bname, len(b)) - } - - // compare contents - line := 1 - offs := 1 - for i := 0; i < len(a) && i < len(b); i++ { - ch := a[i] - if ch != b[i] { - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs)) - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs)) - fmt.Fprintf(&buf, "\n\n") - break - } - if ch == '\n' { - line++ - offs = i + 1 - } - } - - if buf.Len() > 0 { - return errors.New(buf.String()) - } - return nil -} - -// format parses src, prints the corresponding AST, verifies the resulting -// src is syntactically correct, and returns the resulting src or an error -// if any. -func format(src []byte) ([]byte, error) { - formatted, err := Format(src) - if err != nil { - return nil, err - } - - // make sure formatted output is syntactically correct - if _, err := parser.Parse(formatted); err != nil { - return nil, fmt.Errorf("parse: %s\n%s", err, formatted) - } - - return formatted, nil -} - -// lineAt returns the line in text starting at offset offs. -func lineAt(text []byte, offs int) []byte { - i := offs - for i < len(text) && text[i] != '\n' { - i++ - } - return text[offs:i] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden deleted file mode 100644 index 9d4b072a0..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden +++ /dev/null @@ -1,36 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - -// This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = ["fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1, 2] // another line here - -# Another comment -variable = { - description = "bar" # another yooo - - foo { - # Nested standalone - - bar = "fatih" - } -} - -// lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input deleted file mode 100644 index 57c37ac1d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input +++ /dev/null @@ -1,37 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - - // This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = [ "fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1,2] // another line here - - # Another comment -variable = { - description = "bar" # another yooo - foo { - # Nested standalone - - bar = "fatih" - } -} - - // lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden deleted file mode 100644 index 6ff21504c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden +++ /dev/null @@ -1,32 +0,0 @@ -aligned { - # We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - - default = { - bar = "example" - } - - #deneme arslan - fatih = ["fatih"] # yoo4 - - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - - default = { - bar = "example" - } - - security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 - ] - - security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 - ] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input deleted file mode 100644 index bd43ab1ad..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input +++ /dev/null @@ -1,28 +0,0 @@ -aligned { -# We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - default = { - bar = "example" - } - #deneme arslan - fatih = ["fatih"] # yoo4 - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - default = { - bar = "example" - } - -security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 -] - -security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 -] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden deleted file mode 100644 index e778eafa3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input deleted file mode 100644 index e778eafa3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input deleted file mode 100644 index 5d2720672..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input +++ /dev/null @@ -1,37 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node
-
- // This comes from Terraform, as a test
-variable "foo" {
- # Standalone comment should be still here
-
- default = "bar"
- description = "bar" # yooo
-}
-
-/* This is a multi line standalone
-comment*/
-
-
-// fatih arslan
-/* This is a developer test
-account and a multine comment */
-developer = [ "fatih", "arslan"] // fatih arslan
-
-# One line here
-numbers = [1,2] // another line here
-
- # Another comment
-variable = {
- description = "bar" # another yooo
- foo {
- # Nested standalone
-
- bar = "fatih"
- }
-}
-
- // lead comment
-foo {
- bar = "fatih" // line comment 2
-} // line comment 3
-
diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden deleted file mode 100644 index dbeae36a8..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden +++ /dev/null @@ -1,6 +0,0 @@ -resource "blah" "blah" {} - -// -// -// - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input deleted file mode 100644 index 68c4c282e..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input +++ /dev/null @@ -1,5 +0,0 @@ -resource "blah" "blah" {} - -// -// -// diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden deleted file mode 100644 index 74c4ccd89..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden +++ /dev/null @@ -1,12 +0,0 @@ -resource "provider" "resource" { - /* - SPACE_SENSITIVE_CODE = <<EOF -yaml code: - foo: "" - bar: "" -EOF - */ - /* - OTHER - */ -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input deleted file mode 100644 index b07ac4d3c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input +++ /dev/null @@ -1,13 +0,0 @@ -resource "provider" "resource" { - /* - SPACE_SENSITIVE_CODE = <<EOF -yaml code: - foo: "" - bar: "" -EOF - */ - - /* - OTHER - */ -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden deleted file mode 100644 index 7ad7ca296..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden +++ /dev/null @@ -1,7 +0,0 @@ -# This is a multiline comment -# That has values like this: -# -# ami-abcd1234 -# -# Do not delete this comment - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input deleted file mode 100644 index 8b818e91d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input +++ /dev/null @@ -1,6 +0,0 @@ -# This is a multiline comment -# That has values like this: -# -# ami-abcd1234 -# -# Do not delete this comment diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden deleted file mode 100644 index e9db4f2ae..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden +++ /dev/null @@ -1,10 +0,0 @@ -# This is a multiline comment -# That has values like this: -# -# ami-abcd1234 -# -# Do not delete this comment - -resource "aws_instance" "web" { - ami_id = "ami-abcd1234" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input deleted file mode 100644 index 6a8b90230..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input +++ /dev/null @@ -1,10 +0,0 @@ -# This is a multiline comment -# That has values like this: -# -# ami-abcd1234 -# -# Do not delete this comment - -resource "aws_instance" "web" { -ami_id = "ami-abcd1234" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden deleted file mode 100644 index 2162c8845..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden +++ /dev/null @@ -1,3 +0,0 @@ -# Hello -# World - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input deleted file mode 100644 index aa56a9880..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input +++ /dev/null @@ -1,2 +0,0 @@ -# Hello -# World diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden deleted file mode 100644 index 4c0f0004a..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden +++ /dev/null @@ -1,9 +0,0 @@ -variable "environment" { - default = {} - - # default { - # "region" = "us-west-2" - # "sg" = "playground" - # "env" = "prod" - # } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input deleted file mode 100644 index 4c0f0004a..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input +++ /dev/null @@ -1,9 +0,0 @@ -variable "environment" { - default = {} - - # default { - # "region" = "us-west-2" - # "sg" = "playground" - # "env" = "prod" - # } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden deleted file mode 100644 index 3236d9e69..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden +++ /dev/null @@ -1,17 +0,0 @@ -// A standalone comment - -aligned { - # Standalone 1 - - a = "bar" # yoo1 - default = "bar" # yoo2 - - # Standalone 2 -} - -# Standalone 3 - -numbers = [1, 2] // another line here - -# Standalone 4 - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input deleted file mode 100644 index 4436cb16c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input +++ /dev/null @@ -1,16 +0,0 @@ -// A standalone comment - -aligned { - # Standalone 1 - - a = "bar" # yoo1 - default = "bar" # yoo2 - - # Standalone 2 -} - - # Standalone 3 - -numbers = [1,2] // another line here - - # Standalone 4 diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden deleted file mode 100644 index 198c32d28..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden +++ /dev/null @@ -1,54 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -developer = ["fatih", "arslan"] - -provider "aws" { - access_key = "foo" - secret_key = "bar" -} - -provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 -} - -resource aws_instance "web" { - ami = "${var.foo}" - - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}", - ] - - network_interface { - device_index = 0 - description = "Main network interface" - } - - network_interface = { - device_index = 1 - - description = <<EOF -ANOTHER NETWORK INTERFACE -EOF - } -} - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - value = <<EOF -TUBES -EOF -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input deleted file mode 100644 index 712341840..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input +++ /dev/null @@ -1,53 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -developer = [ "fatih", "arslan"] - -provider "aws" { - access_key ="foo" - secret_key = "bar" -} - - provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 - } - - resource aws_instance "web" { - ami = "${var.foo}" - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}" - ] - - network_interface { - device_index = 0 - description = "Main network interface" - } - - network_interface = { - device_index = 1 - description = <<EOF -ANOTHER NETWORK INTERFACE -EOF - } - } - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - - value=<<EOF -TUBES -EOF -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden deleted file mode 100644 index 4ff1cb3e4..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden +++ /dev/null @@ -1,12 +0,0 @@ -variable "foo" {} -variable "foo" {} - -variable "foo" { - # Standalone comment should be still here -} - -foo {} - -foo { - bar = "mssola" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input deleted file mode 100644 index 627bf3e3f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input +++ /dev/null @@ -1,14 +0,0 @@ -variable "foo" {} -variable "foo" { -} - -variable "foo" { - # Standalone comment should be still here -} - -foo { -} - -foo { - bar = "mssola" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden deleted file mode 100644 index 14c37ac0f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden +++ /dev/null @@ -1,43 +0,0 @@ -foo = ["fatih", "arslan"] - -foo = ["bar", "qaz"] - -foo = ["zeynep", - "arslan", -] - -foo = ["fatih", "zeynep", - "arslan", -] - -foo = [ - "vim-go", - "golang", - "hcl", -] - -foo = [] - -foo = [1, 2, 3, 4] - -foo = [ - "kenya", - "ethiopia", - "columbia", -] - -foo = [ - <<EOS -one -EOS - , - <<EOS -two -EOS - , -] - -foo = [<<EOS -one -EOS -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.input deleted file mode 100644 index f55a38200..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.input +++ /dev/null @@ -1,37 +0,0 @@ -foo = ["fatih", "arslan" ] - -foo = [ "bar", "qaz", ] - -foo = [ "zeynep", -"arslan", ] - -foo = ["fatih", "zeynep", -"arslan", ] - -foo = [ - "vim-go", - "golang", "hcl"] - -foo = [] - -foo = [1, 2,3, 4] - -foo = [ - "kenya", "ethiopia", - "columbia"] - -foo = [ - <<EOS -one -EOS -, - <<EOS -two -EOS -, - ] - -foo = [<<EOS -one -EOS - ] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden deleted file mode 100644 index e5753c91a..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden +++ /dev/null @@ -1,7 +0,0 @@ -foo = [1, # Hello - 2, -] - -foo = [1, # Hello - 2, # World -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input deleted file mode 100644 index 1d636c88d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input +++ /dev/null @@ -1,6 +0,0 @@ -foo = [1, # Hello -2] - -foo = [1, # Hello -2, # World -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden deleted file mode 100644 index 401ded6ef..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden +++ /dev/null @@ -1,10 +0,0 @@ -list_of_objects = [ - { - key1 = "value1" - key2 = "value2" - }, - { - key3 = "value3" - key4 = "value4" - }, -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input deleted file mode 100644 index f2adcf015..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input +++ /dev/null @@ -1,10 +0,0 @@ -list_of_objects = [ - { - key1 = "value1" - key2 = "value2" - }, - { - key3 = "value3" - key4 = "value4" - } -]
\ No newline at end of file diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden deleted file mode 100644 index 3d10c741d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden +++ /dev/null @@ -1,7 +0,0 @@ -resource "null_resource" "some_command" { - provisioner "local-exec" { - command = "${echo ' -some newlines -and additonal output'}" - } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input deleted file mode 100644 index 3d10c741d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input +++ /dev/null @@ -1,7 +0,0 @@ -resource "null_resource" "some_command" { - provisioner "local-exec" { - command = "${echo ' -some newlines -and additonal output'}" - } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden deleted file mode 100644 index c3d914702..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden +++ /dev/null @@ -1,26 +0,0 @@ -variable "foo" {} -variable "bar" {} -variable "baz" {} - -variable "qux" {} - -variable "foo" { - foo = "bar" -} - -variable "foo" {} - -# lead comment -variable "bar" {} - -variable "foo" { - default = "bar" -} - -variable "bar" {} - -# Purposeful newline check below: - -variable "foo" {} - -variable "purposeful-newline" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input deleted file mode 100644 index 7b34834a4..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input +++ /dev/null @@ -1,19 +0,0 @@ -variable "foo" {} -variable "bar" {} -variable "baz" {} - -variable "qux" {} -variable "foo" { foo = "bar" } - -variable "foo" {} -# lead comment -variable "bar" {} - -variable "foo" { default = "bar" } -variable "bar" {} - -# Purposeful newline check below: - -variable "foo" {} - -variable "purposeful-newline" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden deleted file mode 100644 index 7e92243f6..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden +++ /dev/null @@ -1,6 +0,0 @@ -obj { - foo = [<<EOF - TEXT! -EOF - ] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input deleted file mode 100644 index d70a05ac9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input +++ /dev/null @@ -1,6 +0,0 @@ -obj { - foo = [<<EOF - TEXT! -EOF - ] -} |