2017-09-10 23:47:27 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('perl', 'perlcritic')
|
2017-09-10 23:47:27 +00:00
|
|
|
call ale#test#SetFilename('test.pl')
|
2018-07-15 17:24:53 +00:00
|
|
|
let g:ale_perl_perlcritic_profile = ''
|
2017-09-10 23:47:27 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! b:readme_path
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-09-10 23:47:27 +00:00
|
|
|
|
|
|
|
Execute(The command should be correct with g:ale_perl_perlcritic_showrules off):
|
|
|
|
let b:ale_perl_perlcritic_showrules = 0
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'perlcritic', ale#Escape('perlcritic')
|
|
|
|
\ . ' --verbose ' . ale#Escape('%l:%c %m\n') . ' --nocolor'
|
2017-09-10 23:47:27 +00:00
|
|
|
|
|
|
|
Execute(The command should be correct with g:ale_perl_perlcritic_showrules on):
|
|
|
|
let b:ale_perl_perlcritic_showrules = 1
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'perlcritic', ale#Escape('perlcritic')
|
|
|
|
\ . ' --verbose ' . ale#Escape('%l:%c %m [%p]\n') . ' --nocolor'
|
2017-09-10 23:47:27 +00:00
|
|
|
|
|
|
|
Execute(The command search for the profile file when set):
|
|
|
|
let b:ale_perl_perlcritic_profile = 'README.md'
|
|
|
|
|
2017-12-19 18:23:09 +00:00
|
|
|
let b:readme_path = ale#path#Simplify(expand('%:p:h:h:h') . '/README.md')
|
2017-09-10 23:47:27 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'perlcritic', ale#Escape('perlcritic')
|
|
|
|
\ . ' --verbose ' . ale#Escape('%l:%c %m\n') . ' --nocolor'
|
|
|
|
\ . ' --profile ' . ale#Escape(b:readme_path)
|
2017-09-10 23:47:27 +00:00
|
|
|
|
|
|
|
Execute(Extra options should be set appropriately):
|
|
|
|
let b:ale_perl_perlcritic_options = 'beep boop'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'perlcritic', ale#Escape('perlcritic')
|
|
|
|
\ . ' --verbose ' . ale#Escape('%l:%c %m\n') . ' --nocolor'
|
|
|
|
\ . ' beep boop'
|