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
chezmoi/private_dot_config/nvim

View file

@ -303,6 +303,15 @@ later(function()
-- provides nice "diagnostics" output
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
local on_attach = function(client, buffnr)
@ -345,6 +354,16 @@ later(function()
})
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()
vim.keymap.set('n', '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', { noremap = true, silent = true })