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 Save g:ale_python_auto_pipenv
3 Save g:ale_python_auto_poetry
5 let g:ale_python_auto_pipenv = 0
6 let g:ale_python_auto_poetry = 0
8 call ale#assert#SetUpLinterTest('python', 'refurb')
10 let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
16 call ale#assert#TearDownLinterTest()
18 Execute(The refurb callbacks should return the correct default values):
19 AssertLinterCwd expand('%:p:h')
20 AssertLinter 'refurb', ale#Escape('refurb') . ' %s'
22 Execute(The option for disabling changing directories should work):
23 let g:ale_python_refurb_change_directory = 0
26 AssertLinter 'refurb', ale#Escape('refurb') . ' %s'
28 Execute(The refurb executable should be configurable, and escaped properly):
29 let g:ale_python_refurb_executable = 'executable with spaces'
31 AssertLinter 'executable with spaces', ale#Escape('executable with spaces') . ' %s'
33 Execute(The refurb command callback should let you set options):
34 let g:ale_python_refurb_options = '--some-flag'
35 AssertLinter 'refurb', ale#Escape('refurb') . ' --some-flag %s'
37 let g:ale_python_refurb_options = '--some-option value'
38 AssertLinter 'refurb', ale#Escape('refurb') . ' --some-option value %s'
40 Execute(The refurb callbacks shouldn't detect virtualenv directories where they don't exist):
41 call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
43 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
44 AssertLinter 'refurb', ale#Escape('refurb') . ' %s'
46 Execute(The refurb callbacks should detect virtualenv directories):
47 call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
48 let b:executable = ale#path#Simplify(
49 \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/refurb'
51 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
52 AssertLinter b:executable, ale#Escape(b:executable) . ' %s'
54 Execute(You should able able to use the global refurb instead):
55 call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
56 let g:ale_python_refurb_use_global = 1
58 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
59 AssertLinter 'refurb', ale#Escape('refurb') . ' %s'
61 Execute(Setting executable to 'pipenv' appends 'run refurb'):
62 let g:ale_python_refurb_executable = 'path/to/pipenv'
63 let g:ale_python_refurb_use_global = 1
65 AssertLinter 'path/to/pipenv', ale#Escape('path/to/pipenv') . ' run refurb %s'
67 Execute(Pipenv is detected when python_refurb_auto_pipenv is set):
68 let g:ale_python_refurb_auto_pipenv = 1
69 call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
71 AssertLinterCwd expand('%:p:h')
72 AssertLinter 'pipenv', ale#Escape('pipenv') . ' run refurb %s'
74 Execute(Setting executable to 'poetry' appends 'run refurb'):
75 let g:ale_python_refurb_executable = 'path/to/poetry'
76 let g:ale_python_refurb_use_global = 1
78 AssertLinter 'path/to/poetry', ale#Escape('path/to/poetry') . ' run refurb %s'
80 Execute(poetry is detected when python_refurb_auto_poetry is set):
81 let g:ale_python_refurb_auto_poetry = 1
82 call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
84 AssertLinterCwd expand('%:p:h')
85 AssertLinter 'poetry', ale#Escape('poetry') . ' run refurb %s'
87 Execute(uv is detected when python_refurb_auto_uv is set):
88 let g:ale_python_refurb_auto_uv = 1
89 call ale#test#SetFilename('../test-files/python/uv/whatever.py')
91 AssertLinterCwd expand('%:p:h')
92 AssertLinter 'uv', ale#Escape('uv') . ' run refurb %s'