]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_gitlint.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '294584081929424aec883f90c7d6515b3743358d' as '.vim/bundle/vim-lsp-ale'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_gitlint.vader
1 Before:
2   call ale#assert#SetUpLinterTest('gitcommit', 'gitlint')
3
4   let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
5
6 After:
7   unlet! b:bin_dir
8   unlet! b:executable
9
10   call ale#assert#TearDownLinterTest()
11
12 Execute(The gitlint callbacks should return the correct default values):
13   AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
14
15 Execute(The gitlint executable should be configurable, and escaped properly):
16   let g:ale_gitcommit_gitlint_executable = 'executable with spaces'
17
18   AssertLinter 'executable with spaces',
19   \ ale#Escape('executable with spaces') . ' lint'
20
21 Execute(The gitlint command callback should let you set options):
22   let g:ale_gitcommit_gitlint_options = '--some-option'
23
24   AssertLinter 'gitlint', ale#Escape('gitlint') . ' --some-option lint'
25
26 Execute(The gitlint callbacks shouldn't detect virtualenv directories where they don't exist):
27   call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/COMMIT_EDITMSG')
28
29   AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
30
31 Execute(The gitlint callbacks should detect virtualenv directories):
32   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
33   let b:executable = ale#path#Simplify(
34   \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/gitlint'
35   \)
36
37   AssertLinter b:executable, ale#Escape(b:executable) . ' lint'
38
39 Execute(You should able able to use the global gitlint instead):
40   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
41   let g:ale_gitcommit_gitlint_use_global = 1
42
43   AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'