summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-07-12 09:22:34 +0100
committerGitHub <noreply@github.com>2017-07-12 09:22:34 +0100
commit9e0d7a9d8cedec4edffe910b706fc03eaf186652 (patch)
tree49a0fd0252372032aab910a5eca441bea19652ed
parent340c0bbac53df00c2d0c00d3e626776c4a6016bf (diff)
parentb2be833744db7e4a293bae5341891a012a276ffc (diff)
downloadale-9e0d7a9d8cedec4edffe910b706fc03eaf186652.zip
Merge pull request #761 from svanharmelen/f-improve-regex
Fixup #756 (gometalinter)
-rw-r--r--ale_linters/go/gometalinter.vim2
-rw-r--r--test/command_callback/test_gometalinter_command_callback.vader6
2 files changed, 4 insertions, 4 deletions
diff --git a/ale_linters/go/gometalinter.vim b/ale_linters/go/gometalinter.vim
index 26bef321..6d10871d 100644
--- a/ale_linters/go/gometalinter.vim
+++ b/ale_linters/go/gometalinter.vim
@@ -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
diff --git a/test/command_callback/test_gometalinter_command_callback.vader b/test/command_callback/test_gometalinter_command_callback.vader
index a0f4da4f..912396cb 100644
--- a/test/command_callback/test_gometalinter_command_callback.vader
+++ b/test/command_callback/test_gometalinter_command_callback.vader
@@ -22,7 +22,7 @@ Execute(The gometalinter callback should return the right defaults):
\ ale_linters#go#gometalinter#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('gometalinter')
- \ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%')))
+ \ . ' --include=' . ale#Escape('^' . ale#util#EscapePCRE(expand('%')))
\ . ' ' . ale#Escape(getcwd()),
\ ale_linters#go#gometalinter#GetCommand(bufnr(''))
@@ -34,7 +34,7 @@ Execute(The gometalinter callback should use a configured executable):
\ ale_linters#go#gometalinter#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('something else')
- \ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%')))
+ \ . ' --include=' . ale#Escape('^' . ale#util#EscapePCRE(expand('%')))
\ . ' ' . ale#Escape(getcwd()),
\ ale_linters#go#gometalinter#GetCommand(bufnr(''))
@@ -43,7 +43,7 @@ Execute(The gometalinter callback should use configured options):
AssertEqual
\ ale#Escape('gometalinter')
- \ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%')))
+ \ . ' --include=' . ale#Escape('^' . ale#util#EscapePCRE(expand('%')))
\ . ' --foobar'
\ . ' ' . ale#Escape(getcwd()),
\ ale_linters#go#gometalinter#GetCommand(bufnr(''))