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_reorder_python_imports_executable
3 Save g:ale_python_reorder_python_imports_options
5 " Use an invalid global executable, so we don't match it.
6 let g:ale_python_reorder_python_imports_executable = 'xxxinvalid'
7 let g:ale_python_reorder_python_imports_options = ''
9 call ale#test#SetDirectory('/testplugin/test/fixers')
11 let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
18 call ale#test#RestoreDirectory()
20 Execute(The reorder_python_imports callback should return the correct default values):
21 silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
25 \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
26 \ . b:bin_dir . '/reorder-python-imports')) . ' -',
28 \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
30 Execute(The reorder_python_imports callback should respect custom options):
31 let g:ale_python_reorder_python_imports_options = '--py3-plus'
33 silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
37 \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
38 \ . b:bin_dir . '/reorder-python-imports')) . ' --py3-plus -',
40 \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
42 Execute(pipenv is detected when python_reorder_python_imports_auto_pipenv is set):
43 let g:ale_python_reorder_python_imports_auto_pipenv = 1
45 call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
49 \ 'command': ale#Escape('pipenv') . ' run reorder-python-imports -',
51 \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
53 Execute(Poetry is detected when python_reorder_python_imports_auto_poetry is set):
54 let g:ale_python_reorder_python_imports_auto_poetry = 1
56 call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
60 \ 'command': ale#Escape('poetry') . ' run reorder-python-imports -',
62 \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
64 Execute(uv is detected when python_reorder_python_imports_auto_uv is set):
65 let g:ale_python_reorder_python_imports_auto_uv = 1
67 call ale#test#SetFilename('../test-files/python/uv/whatever.py')
71 \ 'command': ale#Escape('uv') . ' run reorder-python-imports -',
73 \ ale#fixers#reorder_python_imports#Fix(bufnr(''))