summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-02 21:02:47 +0800
committerruki <[email protected]>2023-02-02 21:02:47 +0800
commitdd97043117dfb6e6b634574137e95a800d774afd (patch)
tree8f112bb3aa6a45424e46659e5a8683e8650a6a1c
parentb081b4fee6af8153fdcfec5fffd6fd64ccea0f6a (diff)
improve showstats
-rw-r--r--xmake/plugins/check/checker.lua2
-rw-r--r--xmake/plugins/check/main.lua9
2 files changed, 9 insertions, 2 deletions
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index 257bc6b41..fb3cf11b7 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -30,7 +30,7 @@ function checkers()
["api.target.languages"] = {description = "Check languages configuration in target."},
["api.target.packages"] = {description = "Check packages configuration in target."},
-- clang tidy checker
- ["clang.tidy"] = {description = "Check project code using clang-tidy."}
+ ["clang.tidy"] = {description = "Check project code using clang-tidy.", showstats = false}
}
_g._CHECKERS = checkers
end
diff --git a/xmake/plugins/check/main.lua b/xmake/plugins/check/main.lua
index dd190624d..9ec6d03fd 100644
--- a/xmake/plugins/check/main.lua
+++ b/xmake/plugins/check/main.lua
@@ -74,10 +74,17 @@ function _check(group_or_name, arguments)
assert(#checked_checkers > 0, "checker(%s) not found!", group_or_name)
-- do checkers
+ local showstats
for _, name in ipairs(checked_checkers) do
+ local info = checkers[name]
+ if showstats == nil and info and info.showstats ~= nil then
+ showstats = info.showstats
+ end
import("checkers." .. name, {anonymous = true})(arguments)
end
- checker.show_stats()
+ if showstats ~= false then
+ checker.show_stats()
+ end
end
function main()