summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-05-25 20:48:16 +0100
committerGitHub <noreply@github.com>2018-05-25 20:48:16 +0100
commit8d49da1f1cc0fadc31f479a05f16f0e423c226a3 (patch)
treec07fd0581d76fdf5fcc4fce65393a7b0bed6a63f /ale_linters
parentd0f579c5fc4f56c531ce587da05f70bf03ecb3e4 (diff)
parent8a1099bb59696185a77422ae12e3e384b0eeb81b (diff)
downloadale-8d49da1f1cc0fadc31f479a05f16f0e423c226a3.zip
Merge pull request #1573 from zed0/master
Run sass-lint from the target's directory
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/sass/sasslint.vim14
-rw-r--r--ale_linters/scss/sasslint.vim14
2 files changed, 24 insertions, 4 deletions
diff --git a/ale_linters/sass/sasslint.vim b/ale_linters/sass/sasslint.vim
index bbe71255..aaaa3d2d 100644
--- a/ale_linters/sass/sasslint.vim
+++ b/ale_linters/sass/sasslint.vim
@@ -1,8 +1,18 @@
-" Author: KabbAmine - https://github.com/KabbAmine
+" Author: KabbAmine - https://github.com/KabbAmine, 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', {
\ 'name': 'sasslint',
\ 'executable': 'sass-lint',
-\ 'command': 'sass-lint -v -q -f compact %t',
+\ 'command_callback': 'ale_linters#sass#sasslint#GetCommand',
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
\})
diff --git a/ale_linters/scss/sasslint.vim b/ale_linters/scss/sasslint.vim
index bd016465..f6075001 100644
--- a/ale_linters/scss/sasslint.vim
+++ b/ale_linters/scss/sasslint.vim
@@ -1,8 +1,18 @@
-" Author: KabbAmine - https://github.com/KabbAmine
+" Author: KabbAmine - https://github.com/KabbAmine, Ben Falconer
+" <ben@falconers.me.uk>
+
+function! ale_linters#scss#sasslint#GetCommand(buffer) abort
+ return ale#path#BufferCdString(a:buffer)
+ \ . ale#Escape('sass-lint')
+ \ . ' -v'
+ \ . ' -q'
+ \ . ' -f compact'
+ \ . ' %t'
+endfunction
call ale#linter#Define('scss', {
\ 'name': 'sasslint',
\ 'executable': 'sass-lint',
-\ 'command': 'sass-lint -v -q -f compact %t',
+\ 'command_callback': 'ale_linters#scss#sasslint#GetCommand',
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
\})