fix(health): don't show warning on `module=false`

This commit is contained in:
Folke Lemaitre 2022-12-21 16:07:49 +01:00
parent b68f94b95a
commit c228908ffc
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 5 additions and 1 deletions

View File

@ -100,6 +100,7 @@ require("lazy").setup({
| **cmd** | `string?` or `string[]` | Lazy-load on command | | **cmd** | `string?` or `string[]` | Lazy-load on command |
| **ft** | `string?` or `string[]` | Lazy-load on filetype | | **ft** | `string?` or `string[]` | Lazy-load on filetype |
| **keys** | `string?` or `string[]` | Lazy-load on key mapping | | **keys** | `string?` or `string[]` | Lazy-load on key mapping |
| **module** | `false?` | Do not automatically load this lua module when it's required somewhere |
### Lazy Loading ### Lazy Loading

View File

@ -37,6 +37,7 @@ function M.check()
"tag", "tag",
"commit", "commit",
"version", "version",
"module",
"pin", "pin",
"cmd", "cmd",
"event", "event",
@ -48,10 +49,12 @@ function M.check()
for _, plugin in pairs(Config.plugins) do for _, plugin in pairs(Config.plugins) do
for key in pairs(plugin) do for key in pairs(plugin) do
if not vim.tbl_contains(valid, key) then if not vim.tbl_contains(valid, key) then
if key ~= "module" or type(plugin.module) ~= "boolean" then
vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">") vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">")
end end
end end
end end
end end
end
return M return M