summaryrefslogtreecommitdiff
path: root/ale_linters/coffee
diff options
context:
space:
mode:
authorEthan Chan <metakirby5@gmail.com>2017-02-02 17:03:26 -0800
committerEthan Chan <metakirby5@gmail.com>2017-02-02 17:03:26 -0800
commit69ce8502a47348f0638a56fbcd87490a63b097de (patch)
treeb43065f8f1cc2890e9ac87de7ce6447abe386657 /ale_linters/coffee
parent1da187a6e5bbf278158ac494f1fa3bf337c4eb50 (diff)
downloadale-69ce8502a47348f0638a56fbcd87490a63b097de.zip
add support for locally installed coffee
Diffstat (limited to 'ale_linters/coffee')
-rw-r--r--ale_linters/coffee/coffee.vim17
1 files changed, 15 insertions, 2 deletions
diff --git a/ale_linters/coffee/coffee.vim b/ale_linters/coffee/coffee.vim
index 243fec6b..ac9ef79e 100644
--- a/ale_linters/coffee/coffee.vim
+++ b/ale_linters/coffee/coffee.vim
@@ -1,10 +1,23 @@
" Author: KabbAmine - https://github.com/KabbAmine
" Description: Coffee for checking coffee files
+function! ale_linters#coffee#coffee#GetExecutable(buffer) abort
+ return ale#util#ResolveLocalPath(
+ \ a:buffer,
+ \ 'node_modules/.bin/coffee',
+ \ 'coffee'
+ \)
+endfunction
+
+function! ale_linters#coffee#coffee#GetCommand(buffer) abort
+ return ale_linters#coffee#coffee#GetExecutable(a:buffer)
+ \ . ' -cp -s'
+endfunction
+
call ale#linter#Define('coffee', {
\ 'name': 'coffee',
-\ 'executable': 'coffee',
-\ 'command': 'coffee -cp -s',
+\ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable',
+\ 'command_callback': 'ale_linters#coffee#coffee#GetCommand',
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#HandleGCCFormat',
\})