aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/trim_whitespace.lua
diff options
context:
space:
mode:
authorxfzv <78810647+xfzv@users.noreply.github.com>2023-09-07 19:29:08 +0000
committerGitHub <noreply@github.com>2023-09-07 12:29:08 -0700
commit37a2d65bd2ee41540cc426d2cffef6d6f8648357 (patch)
tree70b02172bb09651ae32eac4a57577a4116578213 /lua/conform/formatters/trim_whitespace.lua
parent076ac4d7747bde487ed57ac96d0e1575a3bf720b (diff)
feat: add beautysh, taplo, trim_newlines and trim_whitespace (#29)
* feat: add beautysh * feat: add taplo * feat: add trim_newlines * feat: add trim_whitespace * doc: mention that `trim_newlines` and `trim_whitespaces` are using `awk` --------- Co-authored-by: xfzv <>
Diffstat (limited to 'lua/conform/formatters/trim_whitespace.lua')
-rw-r--r--lua/conform/formatters/trim_whitespace.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/conform/formatters/trim_whitespace.lua b/lua/conform/formatters/trim_whitespace.lua
new file mode 100644
index 0000000..7178e0e
--- /dev/null
+++ b/lua/conform/formatters/trim_whitespace.lua
@@ -0,0 +1,9 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://www.gnu.org/software/gawk/manual/gawk.html",
+ description = "Trim whitespaces with awk",
+ },
+ command = "awk",
+ args = { '{ sub(/[ \t]+$/, ""); print }' },
+}