]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_yapf_fixer_callback.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:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_yapf_fixer_callback.vader
1 Before:
2   Save g:ale_python_yapf_executable
3
4   " Use an invalid global executable, so we don't match it.
5   let g:ale_python_yapf_executable = 'xxxinvalid'
6
7   call ale#test#SetDirectory('/testplugin/test/fixers')
8
9   let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
10
11 After:
12   Restore
13
14   unlet! b:bin_dir
15
16   call ale#test#RestoreDirectory()
17
18 Execute(The yapf should include the .style.yapf file if present):
19   call ale#test#SetFilename('../test-files/python/with_virtualenv/dir_with_yapf_config/foo/bar.py')
20
21   AssertEqual
22   \ {
23   \   'command':
24   \     ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yapf'))
25   \     . ' --no-local-style'
26   \     . ' --style ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/dir_with_yapf_config/.style.yapf')),
27   \ },
28   \ ale#fixers#yapf#Fix(bufnr(''))
29
30 Execute(pipenv is detected when python_yapf_auto_pipenv is set):
31   let g:ale_python_yapf_auto_pipenv = 1
32
33   call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
34
35   AssertEqual
36   \ {
37   \   'command': ale#Escape('pipenv') . ' run yapf',
38   \ },
39   \ ale#fixers#yapf#Fix(bufnr(''))
40
41 Execute(Poetry is detected when python_yapf_auto_poetry is set):
42   let g:ale_python_yapf_auto_poetry = 1
43
44   call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
45
46   AssertEqual
47   \ {
48   \   'command': ale#Escape('poetry') . ' run yapf',
49   \ },
50   \ ale#fixers#yapf#Fix(bufnr(''))
51
52 Execute(uv is detected when python_yapf_auto_uv is set):
53   let g:ale_python_yapf_auto_uv = 1
54
55   call ale#test#SetFilename('../test-files/python/uv/whatever.py')
56
57   AssertEqual
58   \ {
59   \   'command': ale#Escape('uv') . ' run yapf',
60   \ },
61   \ ale#fixers#yapf#Fix(bufnr(''))