summaryrefslogtreecommitdiff
path: root/xmake/plugins/check/checker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-01 23:14:57 +0800
committerruki <[email protected]>2023-02-01 23:14:57 +0800
commit8658eae245dafc3b539c6b4280455773caa0ef8a (patch)
tree85ca743be696cffc4d098dffd9cfb758f5094fc3 /xmake/plugins/check/checker.lua
parent87cceb8898b238fa0391ac5ee7085555a408d842 (diff)
stats results
Diffstat (limited to 'xmake/plugins/check/checker.lua')
-rw-r--r--xmake/plugins/check/checker.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index 025b4bde8..257bc6b41 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -58,3 +58,20 @@ function complete(complete, opt)
end
}
end
+
+-- update stats
+function update_stats(level, count)
+ local stats = _g.stats
+ if not stats then
+ stats = {}
+ _g.stats = stats
+ end
+ count = count or 1
+ stats[level] = (stats[level] or 0) + count
+end
+
+-- show stats
+function show_stats()
+ local stats = _g.stats or {}
+ cprint("${bright}%d${clear} notes, ${color.warning}%d${clear} warnings, ${color.error}%d${clear} errors", stats.note or 0, stats.warning or 0, stats.error or 0)
+end