summaryrefslogtreecommitdiff
path: root/ale_linters/sass/sasslint.vim
diff options
context:
space:
mode:
authorHolden <holden@axoni.com>2018-12-07 18:05:20 -0500
committerHolden <holden@axoni.com>2018-12-07 18:05:20 -0500
commit57a04701c3ac1d06efbf16f2ce184c37f0076d16 (patch)
tree8181c0025e95cd941e6abe20b45f579e1f783c08 /ale_linters/sass/sasslint.vim
parentcbc029b2b832e6d70d95e6cf810ab6252b42e643 (diff)
parent9226e13b31474ac17d0c25cd27aa55bff21d55c2 (diff)
downloadale-57a04701c3ac1d06efbf16f2ce184c37f0076d16.zip
Merge branch 'master' of github.com:stegmanh/ale
Diffstat (limited to 'ale_linters/sass/sasslint.vim')
-rw-r--r--ale_linters/sass/sasslint.vim27
1 files changed, 23 insertions, 4 deletions
diff --git a/ale_linters/sass/sasslint.vim b/ale_linters/sass/sasslint.vim
index 4df56dfd..8d24185d 100644
--- a/ale_linters/sass/sasslint.vim
+++ b/ale_linters/sass/sasslint.vim
@@ -1,9 +1,28 @@
-" Author: KabbAmine - https://github.com/KabbAmine,
-" Ben Falconer <ben@falconers.me.uk>
+" Author: sQVe - https://github.com/sQVe
+
+call ale#Set('sass_sasslint_executable', 'sass-lint')
+call ale#Set('sass_sasslint_options', '')
+call ale#Set('sass_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
+
+function! ale_linters#sass#sasslint#GetExecutable(buffer) abort
+ return ale#node#FindExecutable(a:buffer, 'sass_sasslint', [
+ \ 'node_modules/sass-lint/bin/sass-lint.js',
+ \ 'node_modules/.bin/sass-lint',
+ \])
+endfunction
+
+function! ale_linters#sass#sasslint#GetCommand(buffer) abort
+ let l:executable = ale_linters#sass#sasslint#GetExecutable(a:buffer)
+ let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
+
+ return ale#node#Executable(a:buffer, l:executable)
+ \ . (!empty(l:options) ? ' ' . l:options : '')
+ \ . ' -v -q -f compact %t'
+endfunction
call ale#linter#Define('sass', {
\ 'name': 'sasslint',
-\ 'executable': 'sass-lint',
-\ 'command_callback': 'ale#handlers#sasslint#GetCommand',
+\ 'executable_callback': 'ale_linters#sass#sasslint#GetExecutable',
+\ 'command_callback': 'ale_linters#sass#sasslint#GetCommand',
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
\})