From d4f55e03f3c80c4a2ea2df1974d9b61f327d70e4 Mon Sep 17 00:00:00 2001 From: Maciej Litwiniuk Date: Thu, 21 Mar 2024 11:13:08 +0100 Subject: [PATCH 1/2] Adds htmlbeautifier formatter - for eruby files --- .../builtins/formatting/htmlbeautifier.lua | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lua/null-ls/builtins/formatting/htmlbeautifier.lua diff --git a/lua/null-ls/builtins/formatting/htmlbeautifier.lua b/lua/null-ls/builtins/formatting/htmlbeautifier.lua new file mode 100644 index 00000000..eec58908 --- /dev/null +++ b/lua/null-ls/builtins/formatting/htmlbeautifier.lua @@ -0,0 +1,24 @@ +local h = require("null-ls.helpers") +local methods = require("null-ls.methods") + +local FORMATTING = methods.internal.FORMATTING + +return h.make_builtin({ + name = "htmlbeautifier", + meta = { + url = "https://github.com/threedaymonk/htmlbeautifier", + description = + "A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.", + }, + method = FORMATTING, + filetypes = { "eruby" }, + generator_opts = { + command = "htmlbeautifier", + args = { + "$FILENAME", + }, + to_stdin = false, + to_temp_file = true, + }, + factory = h.formatter_factory, +}) From a7ba7a9648308296273cd472616bfc70e2d3b443 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:19:50 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lua/null-ls/builtins/formatting/htmlbeautifier.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/null-ls/builtins/formatting/htmlbeautifier.lua b/lua/null-ls/builtins/formatting/htmlbeautifier.lua index eec58908..4de3abbd 100644 --- a/lua/null-ls/builtins/formatting/htmlbeautifier.lua +++ b/lua/null-ls/builtins/formatting/htmlbeautifier.lua @@ -7,8 +7,7 @@ return h.make_builtin({ name = "htmlbeautifier", meta = { url = "https://github.com/threedaymonk/htmlbeautifier", - description = - "A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.", + description = "A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.", }, method = FORMATTING, filetypes = { "eruby" },