{"id":13819893,"url":"https://github.com/apparentlymart/terraform-clean-syntax","last_synced_at":"2025-05-16T07:32:23.281Z","repository":{"id":56691120,"uuid":"222826212","full_name":"apparentlymart/terraform-clean-syntax","owner":"apparentlymart","description":"A simple tool for Terraform language syntax cleanup, extending terraform fmt","archived":true,"fork":false,"pushed_at":"2020-10-24T23:50:19.000Z","size":27,"stargazers_count":160,"open_issues_count":2,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-05T08:08:31.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apparentlymart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-20T01:42:23.000Z","updated_at":"2024-01-22T07:51:25.000Z","dependencies_parsed_at":"2022-08-15T23:20:57.297Z","dependency_job_id":null,"html_url":"https://github.com/apparentlymart/terraform-clean-syntax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparentlymart%2Fterraform-clean-syntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparentlymart%2Fterraform-clean-syntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparentlymart%2Fterraform-clean-syntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparentlymart%2Fterraform-clean-syntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apparentlymart","download_url":"https://codeload.github.com/apparentlymart/terraform-clean-syntax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225413743,"owners_count":17470617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T08:00:54.556Z","updated_at":"2024-11-19T19:30:50.747Z","avatar_url":"https://github.com/apparentlymart.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# `terraform-clean-syntax`\n\n\u003e **NOTE:** The changes made by this tool were integrated into Terraform's own `terraform fmt` in Terraform v0.14.0, so the functionality in this repository will see no further changes.\n\n`terraform-clean-syntax` is a simple command line tool for performing some\nsmall syntax cleanup steps on Terraform `.tf` configuration files\nautomatically.\n\nSpecifically, it currently knows how to clean up the following:\n\n* Argument values that are just a single template interpolation, like\n  `\"${foo}\"`, are simplified to the equivalent `foo`.\n* Variable type constraints using the legacy forms from Terraform 0.11, like\n  `\"string\"`, `\"list\"`, or `\"map\"`, are replaced with their modern type\n  constraint expressions `string`, `list(string)` and `map(string)`.\n\nThe two changes listed above will both silence some (though not all) of the\nsyntax deprecation warnings emitted by Terraform 0.12.14 and later. This program\nis conservative, so it may skip certain opportunities for cleanup if they are\ntoo complex for it to be sure that the change is safe.\n\nThe built in `terraform fmt` command in Terraform doesn't perform these cleanups\nautomatically at the time of writing, because the Terraform team worried that\nthis would make it difficult for folks to continue maintaining modules that\nare cross-compatible with both Terraform 0.11 and 0.12. The cleanups made by\nthis program will render a configuration incompatible with Terraform 0.11,\nso this program should not be used on any module that must retain Terraform 0.11\ncompatibility.\n\n## Usage\n\nAfter compiling the program using Go 1.12 or later, run it with a single\nargument that is a file or directory to apply rewriting to:\n\n```\nterraform-clean-syntax .\n```\n\nIf given a directory, `terraform-clean-syntax` will visit all of the `.tf`\nfiles in the directory and recursively search any directories within it.\n\nIf given a single file, `terraform-clean-syntax` will process that file only\nif its name has the suffix `.tf`.\n\nThis program rewrites configuration files in-place, so it's best to make sure\nyour version control work tree is clean before running so that you can clearly\nsee which changes it is proposing and discard those changes if desired.\n\nThis program is a best-effort static analysis tool and it doesn't have intimate\nunderstanding of Terraform language syntax, so be sure to review the changes it\nproposes and test your resulting configuration with `terraform validate` and/or\n`terraform plan` before merging the changes into your codebase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapparentlymart%2Fterraform-clean-syntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapparentlymart%2Fterraform-clean-syntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapparentlymart%2Fterraform-clean-syntax/lists"}