Add golangci-lint and "none-ls (previously null-ls)"

This commit is contained in:
Tony Blyler 2024-10-04 12:00:50 -04:00
parent 4321f6ff89
commit 3ad0129720
No known key found for this signature in database
2 changed files with 21 additions and 0 deletions

View file

@ -303,6 +303,15 @@ later(function()
-- provides nice "diagnostics" output -- provides nice "diagnostics" output
source = 'folke/trouble.nvim' source = 'folke/trouble.nvim'
}) })
add({
-- hook up linters
source = 'nvimtools/none-ls.nvim',
depends = {
{
source = 'nvim-lua/plenary.nvim'
}
}
})
-- only perform these mappings if an LSP is attached -- only perform these mappings if an LSP is attached
local on_attach = function(client, buffnr) local on_attach = function(client, buffnr)
@ -345,6 +354,16 @@ later(function()
}) })
end end
-- TODO see if there is a way to automatically do this rather than having to manually specify them
local null_ls = require('null-ls')
null_ls.setup({
-- enable debug if you want to be able to debug null_ls settings
-- debug = true,
sources = {
null_ls.builtins.diagnostics.golangci_lint,
},
})
require('trouble').setup() require('trouble').setup()
vim.keymap.set('n', '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', { noremap = true, silent = true }) vim.keymap.set('n', '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', { noremap = true, silent = true })

View file

@ -7,9 +7,11 @@ return {
["mason-lspconfig.nvim"] = "25c11854aa25558ee6c03432edfa0df0217324be", ["mason-lspconfig.nvim"] = "25c11854aa25558ee6c03432edfa0df0217324be",
["mason.nvim"] = "e2f7f9044ec30067bc11800a9e266664b88cda22", ["mason.nvim"] = "e2f7f9044ec30067bc11800a9e266664b88cda22",
["mini.nvim"] = "848c5e8f428faf843051768e0d56104cd02aea1f", ["mini.nvim"] = "848c5e8f428faf843051768e0d56104cd02aea1f",
["none-ls.nvim"] = "0e0a940477cc08fa7b1799384a1d668058ed4e61",
["nvim-lsp-basics"] = "632714bd3ab355eb6e725b5a78cd8730f12d14d2", ["nvim-lsp-basics"] = "632714bd3ab355eb6e725b5a78cd8730f12d14d2",
["nvim-lspconfig"] = "0678aa439b82965daf03679cd146e84f10e299c3", ["nvim-lspconfig"] = "0678aa439b82965daf03679cd146e84f10e299c3",
["nvim-treesitter"] = "d1e1f17cea23f14cbe230635b9bb654a835f02d7", ["nvim-treesitter"] = "d1e1f17cea23f14cbe230635b9bb654a835f02d7",
["plenary.nvim"] = "2d9b06177a975543726ce5c73fca176cedbffe9d",
["trouble.nvim"] = "6efc446226679fda0547c0fd6a7892fd5f5b15d8", ["trouble.nvim"] = "6efc446226679fda0547c0fd6a7892fd5f5b15d8",
["vim-fugitive"] = "d4877e54cef67f5af4f950935b1ade19ed6b7370", ["vim-fugitive"] = "d4877e54cef67f5af4f950935b1ade19ed6b7370",
["vim-surround"] = "3d188ed2113431cf8dac77be61b842acb64433d9", ["vim-surround"] = "3d188ed2113431cf8dac77be61b842acb64433d9",