Martin Atkins
b0a43cab84
command: "terraform fmt" must fail if file has invalid syntax
...
Since the HCL formatter only works with tokens, it can in principle be
called with any input and produce some output. However, when given invalid
syntax it will tend to produce nonsensical results that may drastically
change the input file and be hard for the user to undo.
Since there's no strong reason to try to format an invalid or incomplete
file, we'll instead try parsing first and fail if parsing does not
complete successfully.
Since we talk directly to the HCL API here this is only a _syntax_ check,
and so it can be applied to files that are invalid in other ways as far
as Terraform is concerned, such as using unsupported top-level block types,
resource types that don't exist, etc.
2019-01-17 14:21:18 -08:00
..
2018-10-16 19:11:09 -07:00
2018-11-19 09:02:35 -08:00
2019-01-15 14:34:49 +00:00
2019-01-11 15:13:55 -08:00
2019-01-11 15:13:55 -08:00
2019-01-11 15:13:55 -08:00
2019-01-14 11:33:21 -08:00
2017-02-15 14:41:55 -05:00
2018-11-23 16:13:34 +01:00
2018-11-20 11:15:16 +01:00
2018-11-20 11:15:16 +01:00
2018-11-23 16:13:34 +01:00
2017-12-05 10:24:04 -08:00
2018-10-16 19:11:09 -07:00
2014-07-12 20:59:16 -07:00
2015-04-29 13:07:13 -05:00
2019-01-14 11:33:21 -08:00
2018-08-03 22:22:55 +02:00
2016-11-14 00:32:01 -08:00
2018-10-16 18:46:46 -07:00
2017-06-09 14:03:59 -07:00
2018-11-23 16:13:34 +01:00
2016-11-21 11:59:20 -05:00
2018-03-28 13:08:38 -04:00
2018-11-23 16:13:34 +01:00
2016-12-10 14:30:40 -05:00
2018-10-16 18:46:46 -07:00
2019-01-17 14:21:18 -08:00
2019-01-17 14:21:18 -08:00
2017-11-03 11:13:31 -04:00
2018-11-23 16:13:34 +01:00
2018-10-16 19:14:11 -07:00
2018-11-23 16:13:34 +01:00
2019-01-14 11:33:21 -08:00
2018-10-16 19:14:11 -07:00
2018-10-16 19:14:11 -07:00
2019-01-16 15:07:57 -06:00
2018-11-23 16:13:34 +01:00
2019-01-14 11:33:21 -08:00
2019-01-16 15:07:57 -06:00
2018-01-09 23:13:33 +00:00
2018-01-05 10:59:30 -05:00
2018-01-05 10:59:30 -05:00
2018-11-19 09:02:35 -08:00
2018-12-18 16:54:09 -08:00
2018-12-18 17:57:44 -05:00
2019-01-14 11:33:21 -08:00
2018-10-16 19:11:09 -07:00
2018-11-23 16:13:34 +01:00
2018-11-05 19:29:34 +01:00
2018-12-19 13:47:42 -08:00
2018-10-16 19:14:11 -07:00
2018-11-23 16:13:34 +01:00
2018-11-20 11:15:16 +01:00
2018-11-23 16:13:34 +01:00
2018-03-28 13:08:38 -04:00
2018-01-16 18:05:26 -08:00
2018-10-16 19:14:11 -07:00
2018-10-16 19:14:11 -07:00
2018-10-16 19:14:11 -07:00
2018-12-17 10:55:16 -08:00
2018-10-16 18:24:47 -07:00
2018-11-20 11:15:16 +01:00
2018-11-23 16:13:34 +01:00
2019-01-11 15:13:55 -08:00
2018-12-19 11:08:25 -08:00
2017-02-28 16:35:46 -05:00
2018-10-19 16:31:12 +02:00
2018-11-23 16:13:34 +01:00
2018-11-06 16:29:46 +01:00
2018-10-27 15:01:07 +02:00
2019-01-08 14:57:52 +01:00
2018-11-19 09:02:35 -08:00
2018-11-23 16:13:34 +01:00
2018-11-20 11:15:16 +01:00
2019-01-08 14:57:52 +01:00
2018-10-27 15:01:07 +02:00
2019-01-08 14:57:52 +01:00
2018-10-27 15:15:25 +02:00
2018-11-23 16:13:34 +01:00
2018-10-16 19:14:11 -07:00
2018-11-20 11:15:16 +01:00
2018-11-23 16:13:34 +01:00
2016-08-22 12:59:48 -07:00
2017-03-01 10:59:17 -08:00
2018-10-16 19:11:09 -07:00
2018-11-23 16:13:34 +01:00
2018-11-20 11:15:16 +01:00
2018-11-23 16:13:34 +01:00
2018-11-26 23:38:37 +00:00
2018-11-23 16:13:34 +01:00
2014-05-24 12:04:43 -07:00
2017-10-25 17:36:24 -07:00
2018-11-08 08:57:11 -08:00
2018-11-23 16:13:34 +01:00
2018-11-23 16:13:34 +01:00
2018-11-23 16:13:34 +01:00
2018-11-23 16:13:34 +01:00
2018-11-23 16:13:34 +01:00
2018-11-23 16:13:34 +01:00