From 6a2c1433270be01627c38db45729a7637eed21d4 Mon Sep 17 00:00:00 2001 From: xiaoshihou514 <108414369+xiaoshihou514@users.noreply.github.com> Date: Thu, 5 Oct 2023 04:30:05 +0800 Subject: [PATCH] feat: zigfmt (#23) authored by @fluctlight-kayaba --- README.md | 1 + lua/guard-collection/formatter.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 54860f0..c3bd1e8 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ - [x] [yapf](https://github.com/google/yapf) - [x] [ruff](https://github.com/astral-sh/ruff) as `ruff format` - [x] [ruff_fix](https://github.com/astral-sh/ruff) as `ruff --fix` +- [ ] [zigfmt](https://github.com/ziglang/zig) ## Linters diff --git a/lua/guard-collection/formatter.lua b/lua/guard-collection/formatter.lua index 42f5c5e..afd32b5 100644 --- a/lua/guard-collection/formatter.lua +++ b/lua/guard-collection/formatter.lua @@ -196,4 +196,10 @@ M.ruff_fix = { fname = true, } +M.zigfmt = { + cmd = 'zig', + args = { 'fmt', '--stdin' }, + stdin = true, +} + return M