nvim/lua/overseer/template/user/clang/clang-tidy.lua

25 lines
737 B
Lua

return {
name = 'clang-tidy',
builder = function()
-- Full path to current file (see :help expand())
local dir = vim.loop.cwd()
local file = vim.fn.expand('%:p')
return {
cmd = { 'clang-tidy' },
-- cmd = { 'c:/Users/uid40528/scoop/apps/llvm/current/bin/clang-tidy.exe' },
args = { file, '-p', 'build_nvim', '--quiet', '--config-file', dir .. '/.clang-tidy' },
cwd = dir,
components = {
{ 'on_result_diagnostics_quickfix', open = false },
{ 'on_output_parse', problem_matcher = '$gcc' },
{ 'on_result_diagnostics', remove_on_restart = true },
{ 'restart_on_save' },
'default',
},
}
end,
condition = {
filetype = { 'cpp' },
},
}