summaryrefslogtreecommitdiff
path: root/xmake/plugins/check/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-01 00:48:23 +0800
committerruki <[email protected]>2023-02-01 00:48:23 +0800
commitc638e5b6111c919b46a676f7eefcc7fead324874 (patch)
tree6b090579059981912438ee4c1ab8ca21e823819f /xmake/plugins/check/main.lua
parent4a9e0dffebbd750cf0f0fa24fbed2d5307c67b90 (diff)
show checkers list
Diffstat (limited to 'xmake/plugins/check/main.lua')
-rw-r--r--xmake/plugins/check/main.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/plugins/check/main.lua b/xmake/plugins/check/main.lua
index 8b34cbcaf..4e862a6ad 100644
--- a/xmake/plugins/check/main.lua
+++ b/xmake/plugins/check/main.lua
@@ -20,6 +20,27 @@
-- imports
import("core.base.option")
+import("core.base.text")
+import("checker")
+
+function _show_list()
+ local tbl = {align = 'l', sep = " "}
+ local checkers = checker.checkers()
+ local groups = {}
+ for name, info in table.orderpairs(checkers) do
+ local groupname = name:split(".", {plain = true})[1]
+ if not groups[groupname] then
+ table.insert(tbl, {})
+ table.insert(tbl, {groupname:sub(1, 1):upper() .. groupname:sub(2) .. " checkers:"})
+ groups[groupname] = true
+ end
+ table.insert(tbl, {{" " .. name, style = "${color.dump.string}"}, info.description})
+ end
+ cprint(text.table(tbl))
+end
function main()
+ if option.get("list") then
+ return _show_list()
+ end
end