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 = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
ruby = { "rufo" }, ruby = { "rufo" },
go = { "gofmt" },
}, },
}, },
} }

View File

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

View File

@ -49,6 +49,7 @@ return {
}, },
}) })
lspconfig.pyright.setup({}) lspconfig.pyright.setup({})
lspconfig.gopls.setup({})
end, end,
}, },
} }