2017-12-20 10:10:07 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('gitcommit', 'gitlint')
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! b:bin_dir
|
|
|
|
unlet! b:executable
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
2017-12-20 10:10:07 +00:00
|
|
|
Execute(The gitlint callbacks should return the correct default values):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
Execute(The gitlint executable should be configurable, and escaped properly):
|
|
|
|
let g:ale_gitcommit_gitlint_executable = 'executable with spaces'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'executable with spaces',
|
|
|
|
\ ale#Escape('executable with spaces') . ' lint'
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
Execute(The gitlint command callback should let you set options):
|
|
|
|
let g:ale_gitcommit_gitlint_options = '--some-option'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gitlint', ale#Escape('gitlint') . ' --some-option lint'
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
Execute(The gitlint callbacks shouldn't detect virtualenv directories where they don't exist):
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#test#SetFilename('python_paths/no_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
2017-12-20 10:10:07 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
Execute(The gitlint callbacks should detect virtualenv directories):
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
2017-12-20 10:49:23 +00:00
|
|
|
let b:executable = ale#path#Simplify(
|
2017-12-20 10:10:07 +00:00
|
|
|
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/gitlint'
|
|
|
|
\)
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter b:executable, ale#Escape(b:executable) . ' lint'
|
2017-12-20 10:10:07 +00:00
|
|
|
|
|
|
|
Execute(You should able able to use the global gitlint instead):
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
2017-12-20 10:10:07 +00:00
|
|
|
let g:ale_gitcommit_gitlint_use_global = 1
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
|