I've installed:
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
When run on an example script I get the expected output:
$ shadow test_shadowing.go
test_shadowing.go:10:3: declaration of "foo" shadows declaration at line 8
But when configuring ALE to use this shadow tool, it doesn't appear to notify me of any issues...
let g:ale_go_govet_options = '-vettool=$(which shadow)'
let g:ale_linters = {'go': ['gopls']}
Note: I've also tried an absolute path instead of a subprocess (e.g.
let g:ale_go_govet_options = '-vettool=/Users/me/go/bin/shadow'
).
If I manually execute the shadow command from vim it works:
:!shadow '%'
/Users/me/Code/test_shadowing.go:10:3: declaration of "foo" shadows declaration at line 8
shell returned 3
Press ENTER or type command to continue
But of course I'd prefer ALE to highlight these issues to me.
UPDATE
I was asked to provide :ALEInfo
...
Current Filetype: go
Available Linters: ['bingo', 'gobuild', 'gofmt', 'golangci-lint', 'golint', 'gometalinter', 'gopls', 'gosimple', 'gotype', 'govet', 'golangserver', 'staticcheck']
Linter Aliases:
'gobuild' -> ['go build']
'govet' -> ['go vet']
Enabled Linters: ['gopls']
Suggested Fixers:
'gofmt' - Fix Go files with go fmt.
'goimports' - Fix Go files imports with goimports.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:
let g:ale_go_go_executable = 'go'
let g:ale_go_golangci_lint_executable = 'golangci-lint'
let g:ale_go_golangci_lint_options = '--enable-all'
let g:ale_go_golangci_lint_package = 0
let g:ale_go_gopls_executable = 'gopls'
let g:ale_go_gopls_options = '--mode stdio'
let g:ale_go_langserver_executable = 'go-langserver'
let g:ale_go_langserver_options = ''
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = v:null
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'go': ['gopls']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = v:null
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '✗'
let g:ale_sign_info = '▲'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '✗'
let g:ale_sign_style_warning = '▲'
let g:ale_sign_warning = '▲'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
:ALEInfo
with your attempts?let g:ale_go_govet_options
in the output (which I expected to, but I could be wrong about whether that should be displayed or not).