Skip to content

Commit 16fd35c

Browse files
committed
refactor: Task.needed => task.skip
1 parent 3768256 commit 16fd35c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lua/lazy/manage/task/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local Process = require("lazy.manage.process")
22

33
---@class LazyTaskDef
4-
---@field needed? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
4+
---@field skip? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
55
---@field run fun(task:LazyTask)
66

77
---@alias LazyTaskState fun():boolean?

lua/lazy/manage/task/plugin.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ local Loader = require("lazy.core.loader")
55
local M = {}
66

77
M.run = {
8-
needed = function(plugin)
9-
return plugin._.dirty and (plugin.opt == false or plugin.run)
8+
skip = function(plugin)
9+
return not (plugin._.dirty and (plugin.opt == false or plugin.run))
1010
end,
1111
run = function(self)
1212
Loader.load(self.plugin, { task = "run" }, { load_start = true })
@@ -52,8 +52,8 @@ M.clean = {
5252
}
5353

5454
M.docs = {
55-
needed = function(plugin)
56-
return plugin._.dirty
55+
skip = function(plugin)
56+
return not plugin._.dirty
5757
end,
5858
run = function(self)
5959
local docs = self.plugin.dir .. "/doc/"

0 commit comments

Comments
 (0)