Skip to content

Commit 9a9f00a

Browse files
followup: use function addr as health check id (#217)
* chore(doc): auto generate docs * followup: use function addr as id for custom health checks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 9c9e9f0 commit 9a9f00a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

doc/guard.nvim.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 10
1+
*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 11
22

33
==============================================================================
44
Table of Contents *guard.nvim-table-of-contents*

lua/guard/health.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,25 @@ end
1818

1919
local function executable_check()
2020
local checked = {}
21+
local custom_checked = {}
2122
for ft, item in pairs(filetype) do
2223
if ft:find(',') then
2324
goto continue
2425
end
2526

2627
-- run executable or custom healt check
2728
for _, conf in ipairs(item.formatter or {}) do
28-
if conf.health then
29+
if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then
2930
conf.health()
31+
table.insert(custom_checked, conf.health)
3032
else
3133
check_cmd(conf, checked)
3234
end
3335
end
3436
for _, conf in ipairs(item.linter or {}) do
35-
if conf.health then
37+
if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then
3638
conf.health()
39+
table.insert(custom_checked, conf.health)
3740
else
3841
check_cmd(conf, checked)
3942
end

0 commit comments

Comments
 (0)