neomake
neomake copied to clipboard
add revive for go
Hi,
Can we have an addition to the go linters for revive? https://github.com/mgechev/revive
I copied the golangci-lint definition and added this locally and it seems to work
function! neomake#makers#ft#go#revive() abort
return {
\ 'exe': 'revive',
\ 'args': ['%t'],
\ 'cwd': '%:h',
\ 'errorformat':
\ '%f:%l:%c: %m,' .
\ '%f:%l: %m'
\ }
endfunction
Thanks
Sure, please create a PR.
From the description it looks like it could be preferred automatically (based on executable('revive') then also over golint?
https://github.com/neomake/neomake/blob/ba38b8786ce68c36fc3cd2139a7820b25bea378a/autoload/neomake/makers/ft/go.vim#L10
Also example output, and a test would be nice to have then here or with the PR.
ah yeah, I can have a look at doing that.
After some more consideration, how would I make it have a -config and -exclude options that you can set?
how would I make it have a -config and -exclude options that you can set?
Does it support config files that it picks up automatically? That's usually the best.
it would appear that revive only looks in your home directory for a config, so I could do something similar to what pylama does
let config_file = neomake#utils#FindGlobFile('revive.toml')
I'm not sure about exclude, but I did just realise it doesn't make sense to have it specified anyway because we're running revive against specific files.
Hmm.. not sure what problem you are trying to solve.
See https://github.com/neomake/neomake/issues/1859 for appending args to existing makers. I think I should finish https://github.com/neomake/neomake/pull/2161.
Does that allow for adding arguments before the last argument?
Because the -config argument has to come before the path you're linting.
The path gets appended automatically in the end (via append_file=1 setting).
Check also https://github.com/neomake/neomake/pull/2161.
ah, awesome :)