Add additional linter support.
This commit is contained in:
parent
b43f18fec9
commit
c3aa716388
21
after/plugin/nvim-lint.lua
Normal file
21
after/plugin/nvim-lint.lua
Normal 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,
|
||||
})
|
@ -149,6 +149,9 @@ require("lazy").setup({
|
||||
|
||||
-- additional formater support
|
||||
"stevearc/conform.nvim",
|
||||
|
||||
-- additional linter support
|
||||
"mfussenegger/nvim-lint",
|
||||
}, {
|
||||
install = {
|
||||
colorscheme = { "catppuccin" },
|
||||
|
Loading…
Reference in New Issue
Block a user