diff --git a/after/plugin/nvim-lint.lua b/after/plugin/nvim-lint.lua new file mode 100644 index 0000000..0fbb1e4 --- /dev/null +++ b/after/plugin/nvim-lint.lua @@ -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, +}) diff --git a/lua/crony/lazy.lua b/lua/crony/lazy.lua index a50094d..fd7231d 100644 --- a/lua/crony/lazy.lua +++ b/lua/crony/lazy.lua @@ -149,6 +149,9 @@ require("lazy").setup({ -- additional formater support "stevearc/conform.nvim", + + -- additional linter support + "mfussenegger/nvim-lint", }, { install = { colorscheme = { "catppuccin" },