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

View File

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