Skip to content

Commit

Permalink
feat: add OpenTofu formatter (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
zidhuss authored Mar 1, 2024
1 parent 192a6d2 commit 68dad93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ You can view this list in vim with `:help conform-formatters`
- [terraform_fmt](https://www.terraform.io/docs/cli/commands/fmt.html) - The terraform-fmt command rewrites `terraform` configuration files to a canonical format and style.
- [terragrunt_hclfmt](https://terragrunt.gruntwork.io/docs/reference/cli-options/#hclfmt) - Format hcl files into a canonical format.
- [tlint](https://github.com/tighten/tlint) - Tighten linter for Laravel conventions with support for auto-formatting.
- [tofu_fmt](https://opentofu.org/docs/cli/commands/fmt/) - The tofu-fmt command rewrites OpenTofu configuration files to a canonical format and style.
- [trim_newlines](https://www.gnu.org/software/gawk/manual/gawk.html) - Trim new lines with awk.
- [trim_whitespace](https://www.gnu.org/software/gawk/manual/gawk.html) - Trim whitespaces with awk.
- [twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer) - Automatically fix Twig Coding Standards issues
Expand Down
9 changes: 9 additions & 0 deletions lua/conform/formatters/tofu_fmt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://opentofu.org/docs/cli/commands/fmt/",
description = "The tofu-fmt command rewrites OpenTofu configuration files to a canonical format and style.",
},
command = "tofu",
args = { "fmt", "-" },
}

0 comments on commit 68dad93

Please sign in to comment.