Enable golangci-lint

This commit is contained in:
Ryan Cavicchioni 2024-11-06 14:46:00 -06:00
parent e3c8d39137
commit c95f1347b1
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
3 changed files with 19 additions and 6 deletions

View File

@ -17,6 +17,7 @@ return {
formatters_by_ft = {
lua = { "stylua" },
ruby = { "rufo" },
go = { "gofmt" },
},
},
}

View File

@ -1,13 +1,24 @@
return {
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
-- ruby = { "rubocop", "standardrb" },
ruby = { "standardrb" },
go = { "golangcilint" },
},
},
config = function()
require("lint").linters_by_ft = {
ruby = { "rubocop", "standardrb" },
local lint = require("lint")
lint.linters_by_ft = {
-- ruby = { "rubocop", "standardrb" },
ruby = { "standardrb" },
go = { "golangcilint" },
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
lint.try_lint()
end,
})
end,

View File

@ -1,14 +1,14 @@
return {
{
"williamboman/mason.nvim",
config = function()
config = function()
require("mason").setup()
end,
},
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim" },
config = function()
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
@ -49,6 +49,7 @@ return {
},
})
lspconfig.pyright.setup({})
lspconfig.gopls.setup({})
end,
},
}