Add additional linter support.

This commit is contained in:
CronyAkatsuki 2023-12-24 20:55:03 +01:00
parent b43f18fec9
commit c3aa716388
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,21 @@
local lint = require("lint")
lint.linters.mypy.args = {
function()
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or "/usr"
return "--python-executable", virtual .. "/bin/python3"
end,
}
lint.linters_by_ft = {
python = { "mypy", "ruff" },
}
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,
})

View File

@ -149,6 +149,9 @@ require("lazy").setup({
-- additional formater support
"stevearc/conform.nvim",
-- additional linter support
"mfussenegger/nvim-lint",
}, {
install = {
colorscheme = { "catppuccin" },