Move the sasslint handlers to one location
This commit is contained in:
parent
8d49da1f1c
commit
51a063be31
@ -1,18 +1,9 @@
|
|||||||
" Author: KabbAmine - https://github.com/KabbAmine, Ben Falconer
|
" Author: KabbAmine - https://github.com/KabbAmine,
|
||||||
" <ben@falconers.me.uk>
|
" Ben Falconer <ben@falconers.me.uk>
|
||||||
|
|
||||||
function! ale_linters#sass#sasslint#GetCommand(buffer) abort
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
|
||||||
\ . ale#Escape('sass-lint')
|
|
||||||
\ . ' -v'
|
|
||||||
\ . ' -q'
|
|
||||||
\ . ' -f compact'
|
|
||||||
\ . ' %t'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('sass', {
|
call ale#linter#Define('sass', {
|
||||||
\ 'name': 'sasslint',
|
\ 'name': 'sasslint',
|
||||||
\ 'executable': 'sass-lint',
|
\ 'executable': 'sass-lint',
|
||||||
\ 'command_callback': 'ale_linters#sass#sasslint#GetCommand',
|
\ 'command_callback': 'ale#handlers#sasslint#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
|
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
|
||||||
\})
|
\})
|
||||||
|
8
autoload/ale/handlers/sasslint.vim
Normal file
8
autoload/ale/handlers/sasslint.vim
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
" Author: KabbAmine - https://github.com/KabbAmine,
|
||||||
|
" Ben Falconer <ben@falconers.me.uk>
|
||||||
|
|
||||||
|
function! ale#handlers#sasslint#GetCommand(buffer) abort
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . ale#Escape('sass-lint')
|
||||||
|
\ . ' -v -q -f compact %t'
|
||||||
|
endfunction
|
@ -1,17 +1,12 @@
|
|||||||
Before:
|
Before:
|
||||||
runtime ale_linters/sass/sasslint.vim
|
|
||||||
|
|
||||||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||||
call ale#test#SetFilename('test.sass')
|
call ale#test#SetFilename('test.sass')
|
||||||
|
|
||||||
After:
|
After:
|
||||||
Restore
|
|
||||||
|
|
||||||
call ale#test#RestoreDirectory()
|
call ale#test#RestoreDirectory()
|
||||||
call ale#linter#Reset()
|
|
||||||
|
|
||||||
Execute(The default sasslint command should be correct):
|
Execute(The default sasslint command should be correct):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
|
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
|
||||||
\ . ale#Escape('sass-lint') . ' -v -q -f compact %t',
|
\ . ale#Escape('sass-lint') . ' -v -q -f compact %t',
|
||||||
\ ale_linters#sass#sasslint#GetCommand(bufnr(''))
|
\ ale#handlers#sasslint#GetCommand(bufnr(''))
|
||||||
|
Loading…
Reference in New Issue
Block a user