2017-06-29 10:40:03 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_pug_puglint_options
|
|
|
|
Save g:ale_pug_puglint_executable
|
|
|
|
Save g:ale_pug_puglint_use_global
|
|
|
|
|
|
|
|
let g:ale_pug_puglint_options = ''
|
|
|
|
let g:ale_pug_puglint_executable = 'pug-lint'
|
|
|
|
let g:ale_pug_puglint_use_global = 0
|
|
|
|
|
2017-07-09 21:43:25 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
2017-06-29 10:40:03 +00:00
|
|
|
|
|
|
|
runtime ale_linters/pug/puglint.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
2017-07-09 21:43:25 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
2017-06-29 10:40:03 +00:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(puglint should detect local executables and package.json):
|
|
|
|
call ale#test#SetFilename('puglint_project/test.pug')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-10-08 22:26:50 +00:00
|
|
|
\ ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
2017-06-29 10:40:03 +00:00
|
|
|
\ ale_linters#pug#puglint#GetExecutable(bufnr(''))
|
2017-10-08 22:26:50 +00:00
|
|
|
|
2017-06-29 10:40:03 +00:00
|
|
|
AssertEqual
|
2017-10-08 22:26:50 +00:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
|
2017-06-29 10:40:03 +00:00
|
|
|
\ . ' -r inline %t',
|
|
|
|
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(puglint should use global executables if configured):
|
|
|
|
let g:ale_pug_puglint_use_global = 1
|
|
|
|
|
|
|
|
call ale#test#SetFilename('puglint_project/test.pug')
|
|
|
|
|
|
|
|
AssertEqual 'pug-lint', ale_linters#pug#puglint#GetExecutable(bufnr(''))
|
2017-10-08 22:26:50 +00:00
|
|
|
|
2017-06-29 10:40:03 +00:00
|
|
|
AssertEqual
|
|
|
|
\ ale#Escape('pug-lint')
|
2017-10-08 22:26:50 +00:00
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
|
2017-06-29 10:40:03 +00:00
|
|
|
\ . ' -r inline %t',
|
|
|
|
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(puglint should detect .pug-lintrc):
|
|
|
|
call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-10-08 22:26:50 +00:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
|
2017-06-29 10:40:03 +00:00
|
|
|
\ . ' -r inline %t',
|
|
|
|
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(puglint should detect .pug-lintrc.js):
|
|
|
|
call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-10-08 22:26:50 +00:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
|
2017-06-29 10:40:03 +00:00
|
|
|
\ . ' -r inline %t',
|
|
|
|
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(puglint should detect .pug-lintrc.json):
|
|
|
|
call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-10-08 22:26:50 +00:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
|
|
|
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
|
2017-06-29 10:40:03 +00:00
|
|
|
\ . ' -r inline %t',
|
|
|
|
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|