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_autopep8_executable
3 Save g:ale_python_autopep8_options
5 " Use an invalid global executable, so we don't match it.
6 let g:ale_python_autopep8_executable = 'xxxinvalid'
7 let g:ale_python_autopep8_options = ''
9 call ale#test#SetDirectory('/testplugin/test/fixers')
12 let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
19 call ale#test#RestoreDirectory()
21 Execute(The autopep8 callback should return the correct default values):
22 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/' . b:bin_dir . '/autopep8')) . ' -'},
26 \ ale#fixers#autopep8#Fix(bufnr(''))
28 Execute(The autopep8 callback should include options):
29 let g:ale_python_autopep8_options = '--some-option'
31 silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
34 \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
35 \ ale#fixers#autopep8#Fix(bufnr(''))
37 Execute(pipenv is detected when python_autopep8_auto_pipenv is set):
38 let g:ale_python_autopep8_auto_pipenv = 1
40 call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
44 \ 'command': ale#Escape('pipenv') . ' run autopep8 -',
46 \ ale#fixers#autopep8#Fix(bufnr(''))
48 Execute(Poetry is detected when python_autopep8_auto_poetry is set):
49 let g:ale_python_autopep8_auto_poetry = 1
51 call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
55 \ 'command': ale#Escape('poetry') . ' run autopep8 -',
57 \ ale#fixers#autopep8#Fix(bufnr(''))
59 Execute(uv is detected when python_autopep8_auto_uv is set):
60 let g:ale_python_autopep8_auto_uv = 1
62 call ale#test#SetFilename('../test-files/python/uv/whatever.py')
66 \ 'command': ale#Escape('uv') . ' run autopep8 -',
68 \ ale#fixers#autopep8#Fix(bufnr(''))