Skip to content

Commit

Permalink
fix(health): don't show warning on module=false
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 21, 2022
1 parent b68f94b commit c228908
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ require("lazy").setup({
| **cmd** | `string?` or `string[]` | Lazy-load on command |
| **ft** | `string?` or `string[]` | Lazy-load on filetype |
| **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

Expand Down
5 changes: 4 additions & 1 deletion lua/lazy/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function M.check()
"tag",
"commit",
"version",
"module",
"pin",
"cmd",
"event",
Expand All @@ -48,7 +49,9 @@ function M.check()
for _, plugin in pairs(Config.plugins) do
for key in pairs(plugin) do
if not vim.tbl_contains(valid, key) then
vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">")
if key ~= "module" or type(plugin.module) ~= "boolean" then
vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">")
end
end
end
end
Expand Down

0 comments on commit c228908

Please sign in to comment.