From 343e459ca646d095d400d5c8b038955ad7a8a6c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Jun 2025 07:55:25 +0000 Subject: [PATCH 1/2] chore(doc): auto generate docs --- doc/guard.nvim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guard.nvim.txt b/doc/guard.nvim.txt index 7651f66..ec00cb5 100644 --- a/doc/guard.nvim.txt +++ b/doc/guard.nvim.txt @@ -1,4 +1,4 @@ -*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 10 +*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 11 ============================================================================== Table of Contents *guard.nvim-table-of-contents* From 6ad5a2fd55af3a090d05acd930594b5b5328d712 Mon Sep 17 00:00:00 2001 From: xiaoshihou Date: Wed, 11 Jun 2025 08:57:55 +0100 Subject: [PATCH 2/2] followup: use function addr as id for custom health checks --- lua/guard/health.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/guard/health.lua b/lua/guard/health.lua index b61287b..d87807d 100644 --- a/lua/guard/health.lua +++ b/lua/guard/health.lua @@ -18,6 +18,7 @@ end local function executable_check() local checked = {} + local custom_checked = {} for ft, item in pairs(filetype) do if ft:find(',') then goto continue @@ -25,15 +26,17 @@ local function executable_check() -- run executable or custom healt check for _, conf in ipairs(item.formatter or {}) do - if conf.health then + if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then conf.health() + table.insert(custom_checked, conf.health) else check_cmd(conf, checked) end end for _, conf in ipairs(item.linter or {}) do - if conf.health then + if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then conf.health() + table.insert(custom_checked, conf.health) else check_cmd(conf, checked) end