@@ -2,13 +2,19 @@ local Config = require("lazy.core.config")
2
2
3
3
local M = {}
4
4
5
+ -- "report_" prefix has been deprecated, use the recommended replacements if they exist.
6
+ local start = vim .health .start or vim .health .report_start
7
+ local ok = vim .health .ok or vim .health .report_ok
8
+ local warn = vim .health .warn or vim .health .report_warn
9
+ local error = vim .health .error or vim .health .report_error
10
+
5
11
function M .check ()
6
- vim . health . report_start (" lazy.nvim" )
12
+ start (" lazy.nvim" )
7
13
8
14
if vim .fn .executable (" git" ) == 1 then
9
- vim . health . report_ok (" Git installed" )
15
+ ok (" Git installed" )
10
16
else
11
- vim . health . report_error (" Git not installd?" )
17
+ error (" Git not installd?" )
12
18
end
13
19
14
20
local sites = vim .opt .packpath :get ()
@@ -22,28 +28,28 @@ function M.check()
22
28
for _ , packs in ipairs (vim .fn .expand (site .. " /pack/*" , false , true )) do
23
29
if not packs :find (" [/\\ ]dist$" ) and vim .loop .fs_stat (packs ) then
24
30
existing = true
25
- vim . health . report_warn (" found existing packages at `" .. packs .. " `" )
31
+ warn (" found existing packages at `" .. packs .. " `" )
26
32
end
27
33
end
28
34
end
29
35
if not existing then
30
- vim . health . report_ok (" no existing packages found by other package managers" )
36
+ ok (" no existing packages found by other package managers" )
31
37
end
32
38
33
39
for _ , name in ipairs ({ " packer" , " plugged" , " paq" }) do
34
40
for _ , path in ipairs (vim .opt .rtp :get ()) do
35
41
if path :find (name , 1 , true ) then
36
- vim . health . report_error (" Found paths on the rtp from another plugin manager `" .. name .. " `" )
42
+ error (" Found paths on the rtp from another plugin manager `" .. name .. " `" )
37
43
break
38
44
end
39
45
end
40
46
end
41
47
42
48
local packer_compiled = vim .fn .stdpath (" config" ) .. " /plugin/packer_compiled.lua"
43
49
if vim .loop .fs_stat (packer_compiled ) then
44
- vim . health . report_error (" please remove the file `" .. packer_compiled .. " `" )
50
+ error (" please remove the file `" .. packer_compiled .. " `" )
45
51
else
46
- vim . health . report_ok (" packer_compiled.lua not found" )
52
+ ok (" packer_compiled.lua not found" )
47
53
end
48
54
49
55
local spec = Config .spec
@@ -52,14 +58,14 @@ function M.check()
52
58
M .check_override (plugin )
53
59
end
54
60
if # spec .notifs > 0 then
55
- vim . health . report_error (" Issues were reported when loading your specs:" )
61
+ error (" Issues were reported when loading your specs:" )
56
62
for _ , notif in ipairs (spec .notifs ) do
57
63
local lines = vim .split (notif .msg , " \n " )
58
64
for _ , line in ipairs (lines ) do
59
65
if notif .level == vim .log .levels .ERROR then
60
- vim . health . report_error (line )
66
+ error (line )
61
67
else
62
- vim . health . report_warn (line )
68
+ warn (line )
63
69
end
64
70
end
65
71
end
@@ -71,7 +77,7 @@ function M.check_valid(plugin)
71
77
for key in pairs (plugin ) do
72
78
if not vim .tbl_contains (M .valid , key ) then
73
79
if key ~= " module" or type (plugin .module ) ~= " boolean" then
74
- vim . health . report_warn (" {" .. plugin .name .. " }: unknown key <" .. key .. " >" )
80
+ warn (" {" .. plugin .name .. " }: unknown key <" .. key .. " >" )
75
81
end
76
82
end
77
83
end
@@ -89,7 +95,7 @@ function M.check_override(plugin)
89
95
90
96
for key , value in pairs (plugin ._ .super ) do
91
97
if not vim .tbl_contains (skip , key ) and plugin [key ] and plugin [key ] ~= value then
92
- vim . health . report_warn (" {" .. plugin .name .. " }: overriding <" .. key .. " >" )
98
+ warn (" {" .. plugin .name .. " }: overriding <" .. key .. " >" )
93
99
end
94
100
end
95
101
end
0 commit comments