add: cocnform ignore patern and nvimlint ignore patern

This commit is contained in:
asep.komarudin 2024-06-26 17:15:35 +07:00
parent 77ec605527
commit 5fe2180144
6 changed files with 25 additions and 7 deletions

View file

@ -28,6 +28,10 @@ return {
["xmlformatter"] = "xmlformat",
}
local ignore = {
["php"] = "tlint",
}
for _, pkg in pairs(mason_reg.get_installed_packages()) do
for _, type in pairs(pkg.spec.categories) do
-- only act upon a formatter
@ -62,8 +66,10 @@ return {
if name_map[pkg.spec.name] ~= nil then
pkg.spec.name = name_map[pkg.spec.name]
end
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
table.insert(formatters_by_ft[ftl], pkg.spec.name)
if ignore[ftl] ~= pkg.spec.name then
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
table.insert(formatters_by_ft[ftl], pkg.spec.name)
end
end
end
end