Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Add HCL configuration formatting builtin support #1361

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lua/null-ls/builtins/formatting/hclfmt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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,
})