dotfiles/nvim/.config/nvim/after/plugin/nvim-lint.lua
Sanchayan Maity 940c66406f
nvim: Use Ruff as Python LSP
Though Ruff is not an LSP in the LSP sense but using it this way
gives us formatting and linting via code actions. All other Python
LSP servers are garbage anyway.
2023-10-26 13:06:11 +05:30

27 lines
755 B
Lua

local nvim_lint = require 'lint'
vim.keymap.set('n', '<Leader>l', ':lua require(\'lint\').try_lint()<CR>', { noremap = true, unique = true })
nvim_lint.linters_by_ft = {
c = { 'clangtidy' },
dockerfile = { 'hadolint' },
fish = { 'fish' },
go = { 'revive' },
haskell = { 'hlint' },
javascript = { 'eslint_d' },
lua = { 'luacheck' },
markdown = { 'vale' },
sh = { 'shellcheck' },
typescript = { 'eslint_d' },
yaml = { 'yamllint' },
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = "*/.github/workflows/*.y{a,}ml",
callback = function()
local linter = require('lint').linters.actionlint
linter.name = 'actionlint'
require("lint").lint(linter)
end,
})