summaryrefslogtreecommitdiff
path: root/ale_linters/html
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-27 17:11:03 +0100
committerw0rp <devw0rp@gmail.com>2017-05-27 17:11:03 +0100
commitc4f22186bd74b85c3ff22fdba2bed7a7d0009148 (patch)
treea6445b94d5bb6c2077da913192ca4430bce23dfe /ale_linters/html
parentb934dc52b6b9bee11fcc4034724f2ed71d918606 (diff)
downloadale-c4f22186bd74b85c3ff22fdba2bed7a7d0009148.zip
Refactor running of local Node programs with a helper function
Diffstat (limited to 'ale_linters/html')
-rw-r--r--ale_linters/html/htmlhint.vim17
1 files changed, 5 insertions, 12 deletions
diff --git a/ale_linters/html/htmlhint.vim b/ale_linters/html/htmlhint.vim
index ab1c6e02..e142d22a 100644
--- a/ale_linters/html/htmlhint.vim
+++ b/ale_linters/html/htmlhint.vim
@@ -1,21 +1,14 @@
" Author: KabbAmine <amine.kabb@gmail.com>, deathmaz <00maz1987@gmail.com>, diartyz <diartyz@gmail.com>
" Description: HTMLHint for checking html files
-" CLI options
-let g:ale_html_htmlhint_options = get(g:, 'ale_html_htmlhint_options', '--format=unix')
-let g:ale_html_htmlhint_executable = get(g:, 'ale_html_htmlhint_executable', 'htmlhint')
-let g:ale_html_htmlhint_use_global = get(g:, 'ale_html_htmlhint_use_global', 0)
+call ale#Set('html_htmlhint_options', '--format=unix')
+call ale#Set('html_htmlhint_executable', 'htmlhint')
+call ale#Set('html_htmlhint_use_global', 0)
function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
- if ale#Var(a:buffer, 'html_htmlhint_use_global')
- return ale#Var(a:buffer, 'html_htmlhint_executable')
- endif
-
- return ale#path#ResolveLocalPath(
- \ a:buffer,
+ return ale#node#FindExecutable(a:buffer, 'html_htmlhint', [
\ 'node_modules/.bin/htmlhint',
- \ ale#Var(a:buffer, 'html_htmlhint_executable')
- \)
+ \])
endfunction
function! ale_linters#html#htmlhint#GetCommand(buffer) abort