dotfiles/home/nvim/files/lua/plugins/nvim-lint.lua

34 lines
1.1 KiB
Lua

return {
"mfussenegger/nvim-lint",
config = function ()
local mypy = require("lint").linters.mypy
mypy.args = {
'--show-column-numbers',
'--show-error-end',
'--hide-error-context',
'--no-color-output',
'--no-error-summary',
'--no-pretty',
'--cache-dir',
vim.fn.stdpath("cache") .. '/mypy',
'--cache-fine-grained',
'--sqlite-cache',
'--skip-cache-mtime-checks',
'--python-executable',
function()
return vim.fn.exepath 'python3' or vim.fn.exepath 'python'
end
}
require("lint").linters_by_ft = {
python = {"mypy"},
}
-- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- callback = function()
-- -- try_lint without arguments runs the linters defined in `linters_by_ft`
-- -- for the current tile type
-- require("lint").try_lint()
-- end,
-- })
end
}