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.
2 call ale#assert#SetUpLinterTest('python', 'vulture')
3 call ale#test#SetFilename('test.py')
5 let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
11 call ale#assert#TearDownLinterTest()
13 Execute(The vulture command callback should lint file directory by default):
14 AssertLinterCwd expand('#' . bufnr('') . ':p:h')
15 AssertLinter 'vulture', ale#Escape('vulture') . ' .'
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')
20 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
21 AssertLinter 'vulture', ale#Escape('vulture') . ' .'
23 Execute(The option for disabling change directory works and only lints file):
24 let g:ale_python_vulture_change_directory = 0
27 AssertLinter 'vulture', ale#Escape('vulture') . ' %s'
29 Execute(The vulture executable should be configurable, and escaped properly):
30 let g:ale_python_vulture_executable = 'executable with spaces'
32 AssertLinter 'executable with spaces', ale#Escape('executable with spaces') . ' .'
34 Execute(The vulture command callback should let you set options):
35 let g:ale_python_vulture_options = '--some-option'
37 AssertLinter 'vulture', ale#Escape('vulture') . ' --some-option .'
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')
42 let b:executable = ale#path#Simplify(
43 \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/vulture'
46 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
47 AssertLinter b:executable, ale#Escape(b:executable) . ' .'
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
53 AssertLinter 'vulture', ale#Escape('vulture') . ' .'
55 Execute(Setting executable to 'pipenv' appends 'run vulture'):
56 let g:ale_python_vulture_executable = 'path/to/pipenv'
58 AssertLinter 'path/to/pipenv', ale#Escape('path/to/pipenv') . ' run vulture' . ' .'
60 Execute(Setting executable to 'poetry' appends 'run vulture'):
61 let g:ale_python_vulture_executable = 'path/to/poetry'
63 AssertLinter 'path/to/poetry', ale#Escape('path/to/poetry') . ' run vulture' . ' .'
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
69 AssertLinter 'pipenv',
70 \ ale#Escape('pipenv') . ' run vulture' . ' .'
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
77 AssertLinter 'poetry',
78 \ ale#Escape('poetry') . ' run vulture' . ' .'
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
85 \ ale#Escape('uv') . ' run vulture' . ' .'