fix ruff config and linting

This commit is contained in:
kyasuda
2025-09-19 11:42:29 -07:00
parent 4589fc08b5
commit 356aac91db
5 changed files with 13 additions and 27 deletions

View File

@@ -25,22 +25,13 @@ return {
local orig_try_lint = lint.try_lint
lint.try_lint = function(...)
local bufnr = vim.api.nvim_get_current_buf()
local buftype = vim.api.nvim_get_option_value("buftype", { buf = bufnr })
-- Skip linting for non-file buffers (like hover docs)
if buftype ~= "" then
local opts = select(2, ...)
local bufnr = (type(opts) == "table" and opts.bufnr) or vim.api.nvim_get_current_buf()
if vim.api.nvim_get_option_value("buftype", { buf = bufnr }) ~= "" then
return
end
return orig_try_lint(...)
end
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
callback = function()
lint.try_lint()
end,
})
end,
event = { "BufReadPre", "BufNewFile" },
}