summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorEthan Chan <metakirby5@gmail.com>2017-02-02 16:56:09 -0800
committerEthan Chan <metakirby5@gmail.com>2017-02-02 16:56:09 -0800
commit1da187a6e5bbf278158ac494f1fa3bf337c4eb50 (patch)
tree6f423225ab0e18e36b60211f37530cecbb12e719 /ale_linters
parent97131262abf31de883bcb65835ed6842f66bbd3b (diff)
downloadale-1da187a6e5bbf278158ac494f1fa3bf337c4eb50.zip
add support for locally installed coffeelint
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/coffee/coffeelint.vim17
1 files changed, 15 insertions, 2 deletions
diff --git a/ale_linters/coffee/coffeelint.vim b/ale_linters/coffee/coffeelint.vim
index 96b8c59d..8b1c713e 100644
--- a/ale_linters/coffee/coffeelint.vim
+++ b/ale_linters/coffee/coffeelint.vim
@@ -1,6 +1,19 @@
" Author: Prashanth Chandra https://github.com/prashcr
" Description: coffeelint linter for coffeescript files
+function! ale_linters#coffee#coffeelint#GetExecutable(buffer) abort
+ return ale#util#ResolveLocalPath(
+ \ a:buffer,
+ \ 'node_modules/.bin/coffeelint',
+ \ 'coffeelint'
+ \)
+endfunction
+
+function! ale_linters#coffee#coffeelint#GetCommand(buffer) abort
+ return ale_linters#coffee#coffeelint#GetExecutable(a:buffer)
+ \ . ' --stdin --reporter csv'
+endfunction
+
function! ale_linters#coffee#coffeelint#Handle(buffer, lines) abort
" Matches patterns like the following:
"
@@ -40,7 +53,7 @@ endfunction
call ale#linter#Define('coffee', {
\ 'name': 'coffeelint',
-\ 'executable': 'coffeelint',
-\ 'command': 'coffeelint --stdin --reporter csv',
+\ 'executable_callback': 'ale_linters#coffee#coffeelint#GetExecutable',
+\ 'command_callback': 'ale_linters#coffee#coffeelint#GetCommand',
\ 'callback': 'ale_linters#coffee#coffeelint#Handle',
\})