]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_vulture.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 '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_vulture.vader
1 Before:
2   call ale#assert#SetUpLinterTest('python', 'vulture')
3   call ale#test#SetFilename('test.py')
4
5   let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
6
7 After:
8   unlet! b:bin_dir
9   unlet! b:executable
10
11   call ale#assert#TearDownLinterTest()
12
13 Execute(The vulture command callback should lint file directory by default):
14   AssertLinterCwd expand('#' . bufnr('') . ':p:h')
15   AssertLinter 'vulture', ale#Escape('vulture') . '  .'
16
17 Execute(The vulture command callback should lint project root, when present):
18   call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
19
20   AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
21   AssertLinter 'vulture', ale#Escape('vulture') . '  .'
22
23 Execute(The option for disabling change directory works and only lints file):
24   let g:ale_python_vulture_change_directory = 0
25
26   AssertLinterCwd ''
27   AssertLinter 'vulture', ale#Escape('vulture') . '  %s'
28
29 Execute(The vulture executable should be configurable, and escaped properly):
30   let g:ale_python_vulture_executable = 'executable with spaces'
31
32   AssertLinter 'executable with spaces', ale#Escape('executable with spaces') . '  .'
33
34 Execute(The vulture command callback should let you set options):
35   let g:ale_python_vulture_options = '--some-option'
36
37   AssertLinter 'vulture', ale#Escape('vulture') . ' --some-option .'
38
39 Execute(The vulture command callback should detect virtualenv directories and switch to the project root):
40   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
41
42   let b:executable = ale#path#Simplify(
43   \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/vulture'
44   \)
45
46   AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
47   AssertLinter b:executable, ale#Escape(b:executable) . '  .'
48
49 Execute(You should able able to use the global vulture instead):
50   call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
51   let g:ale_python_vulture_use_global = 1
52
53   AssertLinter 'vulture', ale#Escape('vulture') . '  .'
54
55 Execute(Setting executable to 'pipenv' appends 'run vulture'):
56   let g:ale_python_vulture_executable = 'path/to/pipenv'
57
58   AssertLinter 'path/to/pipenv', ale#Escape('path/to/pipenv') . ' run vulture' . '  .'
59
60 Execute(Setting executable to 'poetry' appends 'run vulture'):
61   let g:ale_python_vulture_executable = 'path/to/poetry'
62
63   AssertLinter 'path/to/poetry', ale#Escape('path/to/poetry') . ' run vulture' . '  .'
64
65 Execute(pipenv is detected when python_vulture_auto_pipenv is set):
66   call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
67   let g:ale_python_vulture_auto_pipenv = 1
68
69   AssertLinter 'pipenv',
70   \ ale#Escape('pipenv') . ' run vulture' . '  .'
71
72
73 Execute(poetry is detected when python_vulture_auto_poetry is set):
74   call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
75   let g:ale_python_vulture_auto_poetry = 1
76
77   AssertLinter 'poetry',
78   \ ale#Escape('poetry') . ' run vulture' . '  .'
79
80 Execute(uv is detected when python_vulture_auto_uv is set):
81   call ale#test#SetFilename('../test-files/python/uv/whatever.py')
82   let g:ale_python_vulture_auto_uv = 1
83
84   AssertLinter 'uv',
85   \ ale#Escape('uv') . ' run vulture' . '  .'