summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-28 22:26:50 +0800
committerGitHub <[email protected]>2023-11-28 22:26:50 +0800
commit72190603ad0a04debb978c2ba79a0e69dabe473e (patch)
treeace3f10ca136956e5f0aa7bbfff2db8e6eb36587
parentb1a69af220a489014cde717e192c2079414ded8e (diff)
parent16a268b2651ac0fa1fa0ed97068d5f97e2f576ac (diff)
Merge pull request #4440 from SuperSodaSea/feature/clang-tidy/quiet
Add --quiet for xmake check clang.tidy
-rw-r--r--xmake/modules/private/check/checkers/clang/tidy.lua20
1 files changed, 12 insertions, 8 deletions
diff --git a/xmake/modules/private/check/checkers/clang/tidy.lua b/xmake/modules/private/check/checkers/clang/tidy.lua
index e37893918..f05d4b401 100644
--- a/xmake/modules/private/check/checkers/clang/tidy.lua
+++ b/xmake/modules/private/check/checkers/clang/tidy.lua
@@ -30,22 +30,23 @@ import("private.action.require.impl.install_packages")
-- the clang.tidy options
local options = {
- {"l", "list", "k", nil, "Show the clang-tidy checks list."},
- {'j', "jobs", "kv", tostring(os.default_njob()),
+ {"l", "list", "k", nil, "Show the clang-tidy checks list."},
+ {"j", "jobs", "kv", tostring(os.default_njob()),
"Set the number of parallel check jobs."},
- {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."},
- {nil, "create", "k", nil, "Create a .clang-tidy file."},
+ {"q", "quiet", "k", nil, "Run clang-tidy in quiet mode."},
+ {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."},
+ {nil, "create", "k", nil, "Create a .clang-tidy file."},
{nil, "configfile", "kv", nil, "Specify the path of .clang-tidy or custom config file"},
{nil, "checks", "kv", nil, "Set the given checks.",
"e.g.",
" - xmake check clang.tidy --checks=\"*\""},
- {'f', "files", "v", nil, "Set files path with pattern",
+ {"f", "files", "v", nil, "Set files path with pattern",
"e.g.",
" - xmake check clang.tidy -f src/main.c",
" - xmake check clang.tidy -f 'src/*.c" .. path.envsep() .. "src/**.cpp'"},
- {nil, "target", "v", nil, "Check the sourcefiles of the given target.",
+ {nil, "target", "v", nil, "Check the sourcefiles of the given target.",
".e.g",
" - xmake check clang.tidy",
" - xmake check clang.tidy [target]"}
@@ -95,6 +96,9 @@ function _check_sourcefile(clang_tidy, sourcefile, opt)
if opt.configfile then
table.insert(argv, "--config-file=" .. opt.configfile)
end
+ if opt.quiet then
+ table.insert(argv, "--quiet")
+ end
if not path.is_absolute(sourcefile) then
sourcefile = path.absolute(sourcefile, projectdir)
end