Skip to content

Commit 5a1d0e6

Browse files
committed
improve tips
1 parent f2e4d4c commit 5a1d0e6

File tree

1 file changed

+6
-3
lines changed
  • xmake/modules/private/check/checkers/clang

1 file changed

+6
-3
lines changed

xmake/modules/private/check/checkers/clang/tidy.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import("core.project.config")
2626
import("core.project.project")
2727
import("lib.detect.find_tool")
2828
import("async.runjobs")
29+
import("utils.progress")
2930
import("private.action.require.impl.packagenv")
3031
import("private.action.require.impl.install_packages")
3132

@@ -118,10 +119,11 @@ function _check_sourcefiles(clang_tidy, sourcefiles, opt)
118119
end
119120
table.insert(argv, sourcefile)
120121
end
122+
progress.show(100, "clang-tidy.analyzing %s .. %d", sourcefiles[1], #sourcefiles)
121123
local argsfile = os.tmpfile() .. ".args.txt"
122124
io.writefile(argsfile, os.args(argv))
123125
argv = {"@" .. argsfile}
124-
os.execv(clang_tidy.program, argv, {curdir = projectdir})
126+
os.vrunv(clang_tidy.program, argv, {curdir = projectdir})
125127
os.rm(argsfile)
126128
else
127129
-- split sourcefiles
@@ -143,8 +145,9 @@ function _check_sourcefiles(clang_tidy, sourcefiles, opt)
143145

144146
-- run clang-tidy
145147
runjobs("checker.tidy", function (index, total, opt)
146-
local argv = sourcefiles_jobs[index]
147-
os.execv(clang_tidy.program, argv, {curdir = projectdir})
148+
local tidy_argv = sourcefiles_jobs[index]
149+
progress.show(index * 100 / total, "clang-tidy.analyzing %s .. %d", tidy_argv[1], #tidy_argv)
150+
os.vrunv(clang_tidy.program, tidy_argv, {curdir = projectdir})
148151
end, {total = #sourcefiles_jobs, comax = opt.jobs or os.default_njob()})
149152
end
150153
end

0 commit comments

Comments
 (0)