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):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/python/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):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
2017-12-20 10:49:23 +00:00
|
|
|
let b:executable = ale#path#Simplify(
|
2021-03-20 22:11:22 +00:00
|
|
|
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/gitlint'
|
2017-12-20 10:10:07 +00:00
|
|
|
\)
|
|
|
|
|
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):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/python/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'
|