update nvim

This commit is contained in:
kYasuda
2026-08-31 13:48:36 -07:00
parent 67afa82778
commit 17086f43ec
59 changed files with 860 additions and 1798 deletions
+41 -27
View File
@@ -1,39 +1,53 @@
return {
"mfussenegger/nvim-lint",
event = { "BufNewFile", "BufReadPre" },
config = function()
local lint = require("lint")
local parser = require("lint.parser")
lint.linters.pydoclint = {
cmd = "pydoclint",
args = { "--show-filenames-in-every-violation-message=true", "-q" },
stdin = false,
stream = "stderr",
ignore_exitcode = true,
parser = parser.from_pattern("(.+):(%d+): (DOC%d+): (.+)", { "file", "lnum", "code", "message" }, nil, {
severity = vim.diagnostic.severity.WARN,
source = "pydoclint",
}),
}
local python_linters = { "ruff" }
if vim.fn.executable("pydoclint") == 1 then
table.insert(python_linters, "pydoclint")
end
lint.linters_by_ft = {
markdown = { "markdownlint" },
lua = { "luacheck" },
python = { "ruff" },
sh = { "shellcheck" },
json = { "jsonlint" },
yaml = { "yamllint" },
vim = { "vint" },
go = { "golangcilint" },
json = { "jsonlint" },
lua = { "luacheck" },
markdown = { "markdownlint" },
python = python_linters,
sh = { "shellcheck" },
typescript = { "eslint" },
typescriptreact = { "eslint" },
vim = { "vint" },
yaml = { "yamllint" },
}
lint.linters.jsonlint.cmd = "vscode-json-language-server"
lint.linters.shellcheck.args = {
"-s",
"bash",
"-o",
"all",
"-e",
"2250",
}
-- Save original function
local orig_try_lint = lint.try_lint
lint.try_lint = function(...)
local opts = select(2, ...)
local bufnr = (type(opts) == "table" and opts.bufnr) or vim.api.nvim_get_current_buf()
if vim.api.nvim_get_option_value("buftype", { buf = bufnr }) ~= "" then
return
end
return orig_try_lint(...)
end
lint.linters.shellcheck.args = { "-s", "bash", "-o", "all", "-e", "2250" }
local lint_group = vim.api.nvim_create_augroup("LintOnSave", { clear = true })
vim.api.nvim_create_autocmd("BufWritePost", {
group = lint_group,
callback = function(args)
if vim.bo[args.buf].buftype ~= "" then
return
end
lint.try_lint(nil, { bufnr = args.buf })
if vim.fn.executable("codespell") == 1 then
lint.try_lint("codespell", { bufnr = args.buf })
end
end,
})
end,
event = { "BufReadPre", "BufNewFile" },
}