The real fix was not using absolute paths anymore (so not expanding with the `:p` option). The regex was correct and should at least include the `^` character to make sure the string starts with the given path/filename and not references the path/filename in some error description.
This commit is contained in:
Sander van Harmelen 2017-07-12 09:51:44 +02:00
parent 340c0bbac5
commit b2be833744
2 changed files with 4 additions and 4 deletions

View file

@ -14,7 +14,7 @@ function! ale_linters#go#gometalinter#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
return ale#Escape(l:executable)
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
\ . ' --include=' . ale#Escape('^' . ale#util#EscapePCRE(l:filename))
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' ' . ale#Escape(fnamemodify(l:filename, ':h'))
endfunction