summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-03 21:03:22 +0800
committerruki <[email protected]>2025-12-03 21:03:22 +0800
commit17f46147fb94be0285d0696cb564f6ba6c1bb3e1 (patch)
tree860200516ba04e833b4e21cb509e9c73af272238
parent9c78a7642714f89dab6077eb9ecbc683e5551967 (diff)
add -vD in syntax
-rw-r--r--xmake/modules/private/check/checkers/clang/tidy.lua16
-rw-r--r--xmake/modules/private/check/checkers/syntax.lua16
2 files changed, 32 insertions, 0 deletions
diff --git a/xmake/modules/private/check/checkers/clang/tidy.lua b/xmake/modules/private/check/checkers/clang/tidy.lua
index 82e9246fb..a77b3e946 100644
--- a/xmake/modules/private/check/checkers/clang/tidy.lua
+++ b/xmake/modules/private/check/checkers/clang/tidy.lua
@@ -36,6 +36,8 @@ local options = {
{"j", "jobs", "kv", tostring(os.default_njob()),
"Set the number of parallel check jobs."},
{"q", "quiet", "k", nil, "Run clang-tidy in quiet mode."},
+ {"v", "verbose", "k", nil, "Print lots of verbose information for users."},
+ {"D", "diagnosis", "k", nil, "Print lots of diagnosis information (backtrace, check info ..) only for developers."},
{nil, "fix", "k", nil, "Apply suggested fixes."},
{nil, "fix_errors", "k", nil, "Apply suggested errors fixes."},
{nil, "fix_notes", "k", nil, "Apply suggested notes fixes."},
@@ -242,6 +244,17 @@ function main(argv)
, ""
, "Usage: xmake check clang.tidy [options]")
+ -- save option context
+ option.save()
+
+ -- set verbose and diagnosis if specified
+ if args.verbose then
+ option.set("verbose", true)
+ end
+ if args.diagnosis then
+ option.set("diagnosis", true)
+ end
+
-- enter the environments of llvm
local oldenvs = packagenv.enter("llvm")
@@ -272,4 +285,7 @@ function main(argv)
_check(clang_tidy, args)
end
os.setenvs(oldenvs)
+
+ -- restore option context
+ option.restore()
end
diff --git a/xmake/modules/private/check/checkers/syntax.lua b/xmake/modules/private/check/checkers/syntax.lua
index 163e2be55..63c6234a1 100644
--- a/xmake/modules/private/check/checkers/syntax.lua
+++ b/xmake/modules/private/check/checkers/syntax.lua
@@ -35,6 +35,8 @@ local options = {
" - xmake check syntax -f 'src/*.cpp'"},
{"j", "jobs", "kv", tostring(os.default_njob()),
"Set the number of parallel check jobs."},
+ {"v", "verbose", "k", nil, "Print lots of verbose information for users."},
+ {"D", "diagnosis", "k", nil, "Print lots of diagnosis information (backtrace, check info ..) only for developers."},
{nil, "targets", "vs", nil, "Check the sourcefiles of the given target.",
"e.g.",
" - xmake check syntax",
@@ -141,6 +143,17 @@ function main(argv)
, ""
, "Usage: xmake check syntax [options]")
+ -- save option context
+ option.save()
+
+ -- set verbose and diagnosis if specified
+ if args.verbose then
+ option.set("verbose", true)
+ end
+ if args.diagnosis then
+ option.set("diagnosis", true)
+ end
+
-- lock the whole project
project.lock()
@@ -163,5 +176,8 @@ function main(argv)
-- unlock the whole project
project.unlock()
+
+ -- restore option context
+ option.restore()
end