refactor: Task.needed => task.skip

This commit is contained in:
Folke Lemaitre 2022-11-28 13:11:20 +01:00
parent 3768256956
commit 16fd35c285
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
local Process = require("lazy.manage.process")
---@class LazyTaskDef
---@field needed? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
---@field skip? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
---@field run fun(task:LazyTask)
---@alias LazyTaskState fun():boolean?

View File

@ -5,8 +5,8 @@ local Loader = require("lazy.core.loader")
local M = {}
M.run = {
needed = function(plugin)
return plugin._.dirty and (plugin.opt == false or plugin.run)
skip = function(plugin)
return not (plugin._.dirty and (plugin.opt == false or plugin.run))
end,
run = function(self)
Loader.load(self.plugin, { task = "run" }, { load_start = true })
@ -52,8 +52,8 @@ M.clean = {
}
M.docs = {
needed = function(plugin)
return plugin._.dirty
skip = function(plugin)
return not plugin._.dirty
end,
run = function(self)
local docs = self.plugin.dir .. "/doc/"