2018-07-10 13:05:49 +00:00
|
|
|
Before:
|
|
|
|
" This is just one language for the linter.
|
|
|
|
call ale#assert#SetUpLinterTest('markdown', 'remark_lint')
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(The default command should be correct):
|
|
|
|
AssertLinter 'remark',
|
2018-07-10 13:06:43 +00:00
|
|
|
\ ale#Escape('remark') . ' --no-stdout --no-color'
|
2018-07-10 13:05:49 +00:00
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
|
|
|
let b:ale_markdown_remark_lint_executable = 'foobar'
|
|
|
|
|
|
|
|
AssertLinter 'foobar',
|
2018-07-10 13:06:43 +00:00
|
|
|
\ ale#Escape('foobar') . ' --no-stdout --no-color'
|
2018-07-10 13:05:49 +00:00
|
|
|
|
|
|
|
Execute(The options should be configurable):
|
|
|
|
let b:ale_markdown_remark_lint_options = '--something'
|
|
|
|
|
|
|
|
AssertLinter 'remark',
|
2018-07-10 13:06:43 +00:00
|
|
|
\ ale#Escape('remark') . ' --something --no-stdout --no-color'
|
2018-07-10 13:05:49 +00:00
|
|
|
|
|
|
|
Execute(The local executable from .bin should be used if available):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
|
2018-07-10 13:05:49 +00:00
|
|
|
|
|
|
|
AssertLinter
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'),
|
|
|
|
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'))
|
2018-07-10 13:06:43 +00:00
|
|
|
\ . ' --no-stdout --no-color'
|
2018-07-10 13:05:49 +00:00
|
|
|
|
2022-10-29 11:56:09 +00:00
|
|
|
Execute(The global executable should be used if the option is set):
|
2018-07-10 13:05:49 +00:00
|
|
|
let b:ale_markdown_remark_lint_use_global = 1
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
|
2018-07-10 13:05:49 +00:00
|
|
|
|
|
|
|
AssertLinter 'remark', ale#Escape('remark')
|
2018-07-10 13:06:43 +00:00
|
|
|
\ . ' --no-stdout --no-color'
|