2018-01-28 12:44:42 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('html', 'htmlhint')
|
2018-01-28 12:44:42 +00:00
|
|
|
call ale#test#SetFilename('htmlhint_paths/test.html')
|
|
|
|
|
|
|
|
let g:node_executable = ale#path#Simplify(
|
2018-07-15 17:24:53 +00:00
|
|
|
\ g:dir . '/htmlhint_paths/node_modules/.bin/htmlhint'
|
2018-01-28 12:44:42 +00:00
|
|
|
\)
|
|
|
|
let g:config_path = ale#path#Simplify(
|
2018-07-15 17:24:53 +00:00
|
|
|
\ g:dir . '/htmlhint_paths/with_config/.htmlhintrc'
|
2018-01-28 12:44:42 +00:00
|
|
|
\)
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! g:node_executable
|
|
|
|
unlet! g:config_path
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2018-01-28 12:44:42 +00:00
|
|
|
|
|
|
|
Execute(The default command should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter g:node_executable,
|
|
|
|
\ ale#Escape(g:node_executable) . ' --format=unix %t'
|
2018-01-28 12:44:42 +00:00
|
|
|
|
|
|
|
Execute(The global executable should be uesd if the option is set):
|
|
|
|
let g:ale_html_htmlhint_executable = 'foo'
|
|
|
|
let g:ale_html_htmlhint_use_global = 1
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'foo', ale#Escape('foo') . ' --format=unix %t',
|
2018-01-28 12:44:42 +00:00
|
|
|
|
|
|
|
" This is so old configurations which might include this still work.
|
|
|
|
Execute(--format=unix should be removed from the options if added):
|
|
|
|
let g:ale_html_htmlhint_options = '--format=unix'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter g:node_executable,
|
|
|
|
\ ale#Escape(g:node_executable) . ' --format=unix %t'
|
2018-01-28 12:44:42 +00:00
|
|
|
|
|
|
|
Execute(The configuration file should be automatically detected):
|
|
|
|
call ale#test#SetFilename('htmlhint_paths/with_config/test.html')
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter g:node_executable,
|
2018-01-28 12:44:42 +00:00
|
|
|
\ ale#Escape(g:node_executable)
|
|
|
|
\ . ' --config ' . ale#Escape(g:config_path)
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ' --format=unix %t'
|
2018-01-28 12:44:42 +00:00
|
|
|
|
|
|
|
" This is so old configurations which might include the config will work.
|
|
|
|
Execute(The configuration file should be configurable through the options variable):
|
|
|
|
call ale#test#SetFilename('htmlhint_paths/with_config/test.html')
|
|
|
|
let g:ale_html_htmlhint_options = '--config=/foo/bar/.htmlhintrc'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter g:node_executable,
|
2018-01-28 12:44:42 +00:00
|
|
|
\ ale#Escape(g:node_executable)
|
|
|
|
\ . ' --config=/foo/bar/.htmlhintrc'
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ' --format=unix %t'
|