aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/trim_whitespace.lua
diff options
context:
space:
mode:
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 }' },
+}