Fix clang-tidy and add :AP cmd

This commit is contained in:
Thomas Avé 2023-08-28 19:14:35 +02:00
parent 5f74a6a5bf
commit 3344c478ee
2 changed files with 16 additions and 5 deletions

View File

@ -17,8 +17,7 @@ Checks: "*,
-cppcoreguidelines-narrowing-conversions -cppcoreguidelines-narrowing-conversions
-cppcoreguidelines-avoid-magic-numbers -cppcoreguidelines-avoid-magic-numbers
--Wsign-compare --Wsign-compare
-readability-uppercase-literal-suffix -readability-uppercase-literal-suffix"
"
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '' HeaderFilterRegex: ''
FormatStyle: none FormatStyle: none

View File

@ -5,9 +5,19 @@ local function ends_with(path, extension)
end end
local function should_load(path) local function should_load(path)
if string.find(path, "build") or string.find(path, "sfml") then local ignore = {
return false [1] = "rapidjson",
elseif ends_with(path, ".h") or ends_with(path, ".cpp") or ends_with(path, ".cpp") or ends_with(path, ".cpp") then [2] = "json.hpp",
[3] = "build",
[4] = "third-party",
[5] = "sfml",
}
for _, pattern in ipairs(ignore) do
if string.find(path, pattern, 0, true) then
return false
end
end
if ends_with(path, ".h") or ends_with(path, ".cpp") or ends_with(path, ".cpp") or ends_with(path, ".cpp") then
return true return true
end end
end end
@ -29,4 +39,6 @@ function teaching.load()
vim.api.nvim_set_current_dir(cwd) vim.api.nvim_set_current_dir(cwd)
end end
vim.api.nvim_create_user_command("AP", teaching.load, {})
return teaching return teaching