Mitchell Hashimoto
630949a3c5
Merge pull request #190 from hashicorp/b-singleline
...
hcl/printer: singleline objects followed by non-singleline need blank
2017-02-17 08:47:38 -08:00
Mitchell Hashimoto
b943d49ebc
Update .travis.yml
2017-02-17 08:47:33 -08:00
Mitchell Hashimoto
b979c7a8d6
hcl/printer: singleline objects followed by non-singleline need blank
...
Fixes https://github.com/hashicorp/terraform/issues/12017
2017-02-17 08:45:53 -08:00
Mitchell Hashimoto
372e8ddaa1
Merge pull request #186 from hashicorp/b-comments
...
hcl/printer: cleaner handling of standalone comments at end of file
2017-02-01 16:05:34 -08:00
Mitchell Hashimoto
47562ccf19
hcl/printer: cleaner handling of standalone comments at end of file
2017-02-01 16:03:59 -08:00
Mitchell Hashimoto
88e9565e99
Merge pull request #185 from hashicorp/f-list-of-lists
...
hcl/parser: parse list of lists
2017-01-30 13:06:51 -08:00
Mitchell Hashimoto
08c7efd78d
hcl/parser: parse list of lists
2017-01-30 13:05:20 -08:00
Mitchell Hashimoto
db4f076892
Merge pull request #184 from hashicorp/b-singleline-obj
...
hcl/printer: format single line objects to not have newline between
2017-01-24 17:06:35 -08:00
Mitchell Hashimoto
e2dbf84eb0
hcl/printer: format single line objects to not have newline between
...
Fixes #161
See #161 and test cases for examples.
2017-01-24 17:05:35 -08:00
Mitchell Hashimoto
72ac8ca2e6
Merge pull request #183 from hashicorp/b-list-comment
...
hcl/printer: preserve list comment on first line
2017-01-24 16:52:30 -08:00
Mitchell Hashimoto
efcf294794
hcl/printer: preserve list comment on first line
2017-01-24 16:51:14 -08:00
Mitchell Hashimoto
4f21d59dc7
Merge pull request #182 from hashicorp/b-comment
...
hcl/printer: format comments across multiple lines in an object
2017-01-24 16:46:15 -08:00
Mitchell Hashimoto
db65f66984
hcl/printer: format comments across multiple lines in an object
...
https://github.com/hashicorp/terraform/issues/11209
See the TF issue above for an example, and test cases for a fix. This
didn't affect any other formatting tests.
2017-01-24 16:44:23 -08:00
Mitchell Hashimoto
dfbfb1c68d
Merge pull request #181 from hashicorp/b-heredoc-single
...
hcl: print single heredoc elements properly
2017-01-24 16:28:40 -08:00
Mitchell Hashimoto
1bed77586d
hcl: print single heredoc elements properly
2017-01-24 16:26:48 -08:00
Mitchell Hashimoto
8c0b1f045f
hcl/printer: verify list element with one heredoc is formatted properly
2017-01-24 16:19:14 -08:00
Mitchell Hashimoto
39fa3a62ba
Merge pull request #180 from hashicorp/b-bool-list
...
hcl/parser: support bools in lists
2017-01-19 17:07:30 -08:00
Mitchell Hashimoto
e59762bcc7
hcl/parser: support bools in lists
2017-01-19 17:06:02 -08:00
Mitchell Hashimoto
eb6f65b2d7
Merge pull request #177 from hashicorp/b-fmt-heredoc
...
hcl/printer: newline after heredoc items in lists
2017-01-08 16:25:15 -08:00
Mitchell Hashimoto
4f76b0e04a
hcl/printer: newline after heredoc items in lists
2017-01-08 16:24:08 -08:00
Mitchell Hashimoto
e930f8e5fe
hcl/fmtcmd: include filename in error
2017-01-08 16:13:04 -08:00
Mitchell Hashimoto
80e628d796
Merge pull request #176 from theherk/feature/build-on-Go-before-1.7
...
Modify new bytes.ContainsRune to backward compatible bytes.IndexRune
2016-12-15 14:58:39 -08:00
Herkermer Sherwood
f3dd3ed758
Modify new bytes.ContainsRune to backward compatible bytes.IndexRune
2016-12-15 14:49:10 -08:00
James Bardin
dd5495f43c
Fix newlines in test-fixture
...
hcl/parser/test-fixtures/comment.hcl already contained CRLF line
endings. Convert that to unix and remove the extra cariiage returns
from comment_crlf.hcl.
2016-12-01 13:05:58 -05:00
James Bardin
aaca009935
Don't convert windows newlines
...
If the canonical newline is a single LF, don't insert CRLF in tests
2016-12-01 12:10:09 -05:00
James Bardin
a97a4ff95f
No longer preserve CRLF line endings
...
Matching the behavior of Go tooling, we are going to accept "\r\n" line
endings, but standaradize on "\n" being the official format.
Normalize line endings to "\n in the Parse function, so that we
never get stray "\r" characters in the source.
2016-12-01 12:09:33 -05:00
James Bardin
86950618a5
Don't automatically convert to CRLF in AppVeyor
...
We have test files with both types of line endings, leave them as they
are for tests.
2016-12-01 12:09:33 -05:00
Mitchell Hashimoto
37ab263305
Merge pull request #174 from kron4eg/decode-int
...
Try to use SetInt in case if possible
2016-12-01 09:17:04 -05:00
Artiom Diomin
e6cd87d208
Try to use SetInt in case if possible
...
Allows to decode aliased int types, like time.Duration
2016-12-01 16:15:23 +02:00
Mitchell Hashimoto
ae25c981c1
hcl/scanner: test \r\n endings
2016-11-30 19:39:16 -05:00
Mitchell Hashimoto
b97feebd3d
Merge pull request #172 from hashicorp/b-println
...
hcl/parser: don't print "illegal"
2016-11-30 12:58:18 -08:00
Mitchell Hashimoto
6000b27b60
hcl/parser: don't print "illegal"
...
We shouldn't output any text during parsing, that's just strange!
token.ILLEGAL happens when the scanner has an error. This error is
recorded in `scerr` during parsing which is eventually returned out.
Therefore, we handle the error properly. We can simply return a backup
error here in case we don't (scanner errors are checked first).
2016-11-30 12:55:04 -08:00
Mitchell Hashimoto
5550aaba78
Merge pull request #139 from VladRassokhin/multiline-string
...
Support EOL in string literals only in HIL fragments
2016-11-29 10:26:28 -08:00
Vladislav Rassokhin
2b0eb1f52c
Support multiline string literals in HCL only in HIL fragments
2016-11-24 22:59:50 +03:00
Mitchell Hashimoto
7cb7455c28
Merge pull request #170 from hashicorp/b-null
...
hcl: error if we scan a null char before end of input text
2016-11-21 18:11:24 -08:00
Mitchell Hashimoto
d02cd46b72
hcl: error if we scan a null char before end of input text
...
This was allowing very strange input to be allowed through to Terraform
since some encryped output will contain null characters (such as from
git crypt).
2016-11-21 18:09:54 -08:00
Mitchell Hashimoto
c3e054bfd4
Merge pull request #169 from jMarkP/duplicate-unit-test
...
Remove duplicate unit test
2016-11-12 15:52:43 -08:00
Mark Pim
fb052f74db
Remove duplicate unit test
2016-11-12 19:14:56 +00:00
Mitchell Hashimoto
3d702911d9
Merge pull request #166 from hashicorp/b-comment-indent
...
hcl/printer: multiline comments shouldn't indent lines 2+
2016-11-09 14:51:35 -08:00
Mitchell Hashimoto
be7f043b9a
hcl/printer: multiline comments shouldn't indent lines 2+
2016-11-09 14:49:37 -08:00
Mitchell Hashimoto
973f376f0e
Merge pull request #150 from hashicorp/b-escape-interp
...
[DO NOT MERGE YET] hcl: don't escape ANYTHING in ${}, let lower layer handle it
2016-11-08 16:00:27 -08:00
Mitchell Hashimoto
f74cf82815
Merge pull request #165 from hashicorp/b-string-fmt
...
hcl/printer: multiline strings don't indent lines 2+
2016-11-03 18:42:59 -07:00
Mitchell Hashimoto
9235fed8ea
hcl/printer: multiline strings don't indent lines 2+
...
Fixes https://github.com/hashicorp/terraform/issues/9859
For strings that have more than one line, we should not indent the
follow-up lines.
2016-11-03 18:41:17 -07:00
Mitchell Hashimoto
6e968a3fcd
Merge pull request #163 from hashicorp/sethvargo/failing_fmt
...
Add failing format example
2016-11-01 11:00:25 -07:00
Mitchell Hashimoto
8038a0f2f9
hcl/printer: proper spacing between comments (see test case)
2016-11-01 10:59:20 -07:00
Seth Vargo
a51830c4c6
Add just comment version
2016-10-31 12:04:45 -04:00
Seth Vargo
29ca4441dd
Add failing format example
2016-10-31 11:59:07 -04:00
Mitchell Hashimoto
8fa153c5b4
Merge pull request #160 from hashicorp/b-json-empty-list
...
json/parser: empty list value should not flatten
2016-10-28 19:32:40 -04:00
Mitchell Hashimoto
c03d57b578
json/parser: empty list value should not flatten
...
Fixes https://github.com/hashicorp/terraform/issues/8886
While parsing JSON, an empty list value would be assumed to be a
non-existent list of objects, and would be removed from the result. This
may have never been the correct behavior but always worked okay because
we previously didn't support lists as first class types.
With the support of lists, we need to actually return the empty list as
the type. If we return nothing, then projects like Terraform will think
that the value was never set, which is false.
2016-10-25 10:44:39 -07:00
Mitchell Hashimoto
99ce73d4fe
Merge pull request #159 from hashicorp/b-obj-parse
...
hcl/parser: cleaner error handling for objects with empty keys #158
2016-10-19 10:07:01 -07:00