{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/17471","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/17471/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/17471/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/17471/events","html_url":"https://github.com/hashicorp/terraform/issues/17471","id":301235250,"number":17471,"title":"Terraform fmt adds a trailing comma after the last item on a list","user":{"login":"katgironpe","id":50656,"avatar_url":"https://avatars0.githubusercontent.com/u/50656?v=4","gravatar_id":"","url":"https://api.github.com/users/katgironpe","html_url":"https://github.com/katgironpe","followers_url":"https://api.github.com/users/katgironpe/followers","following_url":"https://api.github.com/users/katgironpe/following{/other_user}","gists_url":"https://api.github.com/users/katgironpe/gists{/gist_id}","starred_url":"https://api.github.com/users/katgironpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katgironpe/subscriptions","organizations_url":"https://api.github.com/users/katgironpe/orgs","repos_url":"https://api.github.com/users/katgironpe/repos","events_url":"https://api.github.com/users/katgironpe/events{/privacy}","received_events_url":"https://api.github.com/users/katgironpe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-01T00:26:37Z","updated_at":"2018-03-01T06:14:12Z","closed_at":"2018-03-01T06:14:12Z","author_association":"NONE","body":"### Terraform Version\r\n\r\n```\r\nv0.11.3\r\n```\r\n\r\n### Terraform Configuration Files\r\n\r\n```hcl\r\ndata \"aws_iam_policy_document\" \"logs\" {\r\n  statement {\r\n    effect = \"Allow\"\r\n\r\n    actions = [\r\n      \"logs:CreateLogGroup\",\r\n      \"logs:CreateLogStream\",\r\n      \"logs:PutLogEvents\",\r\n    ]\r\n\r\n    resources = [\r\n      \"arn:aws:logs:*:*:*\",\r\n    ]\r\n  }\r\n}\r\n\r\n```\r\n\r\n\r\n### Expected Behavior\r\n\r\nThe `terraform fmt` command should not add a trailing comma for the last item in a list. \r\n\r\n### Actual Behavior\r\n\r\nThe `terraform fmt` command adds a trailing comma for the last item in the list.\r\n\r\n### Steps to Reproduce\r\n\r\nPlease list the full steps required to reproduce the issue, for example:\r\n1.  Copy these lines of code on a file like `test.tf`:\r\n\r\n  ```hcl\r\ndata \"aws_iam_policy_document\" \"logs\" {\r\n  statement {\r\n    effect = \"Allow\"\r\n\r\n    actions = [\r\n      \"logs:CreateLogGroup\",\r\n      \"logs:CreateLogStream\",\r\n      \"logs:PutLogEvents\"\r\n    ]\r\n\r\n    resources = [\r\n      \"arn:aws:logs:*:*:*\",\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n2. `terraform fmt`\r\n\r\n\r\n### Additional Context\r\n\r\nFrom my perspective of good code, that comma shouldn't be there unless there is something I am not aware of. \r\n\r\n### References\r\n\r\nRelated but not quite:\r\n\r\n- #13025\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/369485334","html_url":"https://github.com/hashicorp/terraform/issues/17471#issuecomment-369485334","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/17471","id":369485334,"user":{"login":"katgironpe","id":50656,"avatar_url":"https://avatars0.githubusercontent.com/u/50656?v=4","gravatar_id":"","url":"https://api.github.com/users/katgironpe","html_url":"https://github.com/katgironpe","followers_url":"https://api.github.com/users/katgironpe/followers","following_url":"https://api.github.com/users/katgironpe/following{/other_user}","gists_url":"https://api.github.com/users/katgironpe/gists{/gist_id}","starred_url":"https://api.github.com/users/katgironpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katgironpe/subscriptions","organizations_url":"https://api.github.com/users/katgironpe/orgs","repos_url":"https://api.github.com/users/katgironpe/repos","events_url":"https://api.github.com/users/katgironpe/events{/privacy}","received_events_url":"https://api.github.com/users/katgironpe/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T06:14:12Z","updated_at":"2018-03-01T06:14:12Z","author_association":"NONE","body":"It seems like a trivial one. Lists are always easy to edit. The diff part... I get it. Closing given this seems to have been decided to be a feature. "}}
{"actor":{"display_login":"katgironpe"}}