Add debugger for python and reorder linting logic

This commit is contained in:
salomaestro
2024-12-21 14:57:22 +01:00
parent 4d7d3d4803
commit baf14d1b8e
5 changed files with 185 additions and 49 deletions

23
lua/configs/lint.lua Normal file
View File

@@ -0,0 +1,23 @@
local lint = require "lint"
lint.linters_by_ft = {
python = { "ruff" },
yaml = { "yamllint" },
lua = { "selene" },
}
local ns = lint.get_namespace "ruff"
vim.diagnostic.config({ virtual_text = false, underline = false }, ns)
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
-- group = lint_augroup,
-- callback = function()
-- lint.try_lint()
-- end,
-- })
vim.keymap.set("n", "<leader>ld", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })