Closed rami3l closed 1 month ago
I think null_ls = {},
reset the settings
the default is
null_ls = {
golangci_lint = {
-- disable = {'errcheck', 'staticcheck'}, -- linters to disable empty by default
-- enable = {'govet', 'ineffassign','revive', 'gosimple'}, -- linters to enable; empty by default
},
},
I think
null_ls = {},
reset the settings the default isnull_ls = { golangci_lint = { -- disable = {'errcheck', 'staticcheck'}, -- linters to disable empty by default -- enable = {'govet', 'ineffassign','revive', 'gosimple'}, -- linters to enable; empty by default }, },
@ray-x Thanks for the prompt reply! Looks like this has something to do with opts = { disable_defaults = true }
in the base config. Is this breakage intentional? [^1]
I believe that _GO_NVIM_CFG.null_ls
has been set to {}
in:
https://github.com/ray-x/go.nvim/blob/e80846dec565dac6418334cfc4eecc087678ff69/lua/go.lua#L201-L210
[^1]: ... so in other words, it looks like changing disable_defaults
in "ray-x/go.nvim"
's opts
has broken golangci_lint()
. IMHO this probably should not happen.
It looks like 294d65c93514f14fbbe8af0545ab8918d939acdb has addressed the issue for me. Many thanks :)
@ray-x just a heads up, this breaks the diagnostics
disabling when calling disable_defaults
. This is because diagnostics
should be getting set to false
.
I'm not sure exactly if it breaks other default disabling, but it seems like not a very robust approach when the values that are expected for disabling differ between the options
It is a bug when a value can be either bool or list. I pushed a fix for it. 4274cb3fb31113c93485877d0d2b77cc80383da9
Thanks a lot for making this plugin!
Recently I have encountered the above error when using this config derived from the project README's
null-ls
section:Looking at the
golangci_lint()
function being called:https://github.com/ray-x/go.nvim/blob/e80846dec565dac6418334cfc4eecc087678ff69/lua/go/null_ls.lua#L174-L175
... and particularly L201:
https://github.com/ray-x/go.nvim/blob/e80846dec565dac6418334cfc4eecc087678ff69/lua/go/null_ls.lua#L201-L207
... it looks like
_GO_NVIM_CFG.null_ls
exists, but not_GO_NVIM_CFG.null_ls.golangci_lint
(so this will generate anil
), and_GO_NVIM_CFG.null_ls.golangci_lint.disable
will cause an index error (same for L204). The current code has failed to handle this case.:lua = _GO_NVIM_CFG
```lua { build_tags = "", comment_placeholder = " ", dap_debug = true, dap_debug_gui = {}, dap_debug_keymap = true, dap_debug_vt = {}, dap_port = 38697, dap_retries = 20, dap_timeout = 15, diagnostic = {}, disable_defaults = false, disable_per_project_cfg = false, fillstruct = "gopls", floaterm = {}, go = "go", go_boilplater_url = "https://github.com/thockin/go-build-template.git", go_input =FWIW I'm using AstroNvim's Golang pack as my base config on Neovim v0.10, if this helps.