2019-03-15 21:21:48 +00:00
|
|
|
Before:
|
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
|
|
|
|
runtime ale_linters/json/jsonlint.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
let g:ale_json_jsonlint_executable = 'jsonlint'
|
|
|
|
let g:ale_json_jsonlint_use_global = 0
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(local executable should be detected correctly):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/jsonlint/app/src/app.json')
|
2019-03-15 21:21:48 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/jsonlint/app/node_modules/.bin/jsonlint'),
|
2019-03-15 21:21:48 +00:00
|
|
|
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(recursively executable should be detected correctly):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/jsonlint/app-without-jsonlint/src/app.json')
|
2019-03-15 21:21:48 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/jsonlint/node_modules/jsonlint/lib/cli.js'),
|
2019-03-15 21:21:48 +00:00
|
|
|
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(use_global should override project executable):
|
|
|
|
let g:ale_json_jsonlint_use_global = 1
|
|
|
|
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/jsonlint/app/src/app.json')
|
2019-03-15 21:21:48 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ 'jsonlint',
|
|
|
|
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(manually defined should override default executable):
|
|
|
|
let g:ale_json_jsonlint_use_global = 1
|
|
|
|
let g:ale_json_jsonlint_executable = 'custom_jsonlint'
|
|
|
|
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/jsonlint/app/src/app.json')
|
2019-03-15 21:21:48 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ 'custom_jsonlint',
|
|
|
|
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
|
|
|
|