Merge pull request #295 from metakirby5/pr/coffeelint-local

Add support for locally installed coffee and coffeelint
This commit is contained in:
w0rp 2017-02-09 18:44:52 +00:00 committed by GitHub
commit 943fe9b4b0
2 changed files with 30 additions and 4 deletions

View File

@ -1,10 +1,23 @@
" Author: KabbAmine - https://github.com/KabbAmine " Author: KabbAmine - https://github.com/KabbAmine
" Description: Coffee for checking coffee files " 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', { call ale#linter#Define('coffee', {
\ 'name': 'coffee', \ 'name': 'coffee',
\ 'executable': 'coffee', \ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable',
\ 'command': 'coffee -cp -s', \ 'command_callback': 'ale_linters#coffee#coffee#GetCommand',
\ 'output_stream': 'stderr', \ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#HandleGCCFormat', \ 'callback': 'ale#handlers#HandleGCCFormat',
\}) \})

View File

@ -1,6 +1,19 @@
" Author: Prashanth Chandra https://github.com/prashcr " Author: Prashanth Chandra https://github.com/prashcr
" Description: coffeelint linter for coffeescript files " 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 function! ale_linters#coffee#coffeelint#Handle(buffer, lines) abort
" Matches patterns like the following: " Matches patterns like the following:
" "
@ -40,7 +53,7 @@ endfunction
call ale#linter#Define('coffee', { call ale#linter#Define('coffee', {
\ 'name': 'coffeelint', \ 'name': 'coffeelint',
\ 'executable': 'coffeelint', \ 'executable_callback': 'ale_linters#coffee#coffeelint#GetExecutable',
\ 'command': 'coffeelint --stdin --reporter csv', \ 'command_callback': 'ale_linters#coffee#coffeelint#GetCommand',
\ 'callback': 'ale_linters#coffee#coffeelint#Handle', \ 'callback': 'ale_linters#coffee#coffeelint#Handle',
\}) \})