From e1fb7e2b2e4400835e23b9603a19813be119852b Mon Sep 17 00:00:00 2001 From: Corentin Prevost Date: Tue, 24 Jan 2023 11:52:42 +0100 Subject: [PATCH] Format hcl/nomad filetypes using terraform fmt (#1353) --- lua/null-ls/builtins/formatting/hclfmt.lua | 19 ------------------- .../builtins/formatting/terraform_fmt.lua | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 lua/null-ls/builtins/formatting/hclfmt.lua diff --git a/lua/null-ls/builtins/formatting/hclfmt.lua b/lua/null-ls/builtins/formatting/hclfmt.lua deleted file mode 100644 index 1decd310d..000000000 --- a/lua/null-ls/builtins/formatting/hclfmt.lua +++ /dev/null @@ -1,19 +0,0 @@ -local h = require("null-ls.helpers") -local methods = require("null-ls.methods") - -local FORMATTING = methods.internal.FORMATTING - -return h.make_builtin({ - name = "hclfmt", - meta = { - url = "https://github.com/fatih/hclfmt", - description = "Formatter for HCL configuration files", - }, - method = FORMATTING, - filetypes = { "hcl" }, - generator_opts = { - command = "hclfmt", - to_stdin = true, - }, - factory = h.formatter_factory, -}) diff --git a/lua/null-ls/builtins/formatting/terraform_fmt.lua b/lua/null-ls/builtins/formatting/terraform_fmt.lua index 40a2c301a..543e5e98a 100644 --- a/lua/null-ls/builtins/formatting/terraform_fmt.lua +++ b/lua/null-ls/builtins/formatting/terraform_fmt.lua @@ -10,7 +10,7 @@ return h.make_builtin({ description = "The terraform-fmt command rewrites `terraform` configuration files to a canonical format and style.", }, method = FORMATTING, - filetypes = { "terraform", "tf", "terraform-vars" }, + filetypes = { "terraform", "tf", "terraform-vars", "hcl", "nomad" }, generator_opts = { command = "terraform", args = {