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.
5 Save g:ale_shell_arguments
8 Save b:ale_shell_arguments
11 unlet! b:ale_shell_arguments
14 unlet! g:ale_shell_arguments
19 Execute(sh should be used when the shell is fish):
21 " Set something else, so we will replace that too.
22 let &shellcmdflag = '-f'
25 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
27 let &shell = '/usr/bin/fish'
29 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
31 let &shell = '/usr/local/bin/fish'
33 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
36 Execute(sh should be used when the shell is powershell):
38 " Set something else, so we will replace that too.
39 let &shellcmdflag = '-f'
42 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
44 let &shell = '/usr/bin/pwsh'
46 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
48 let &shell = '/usr/local/bin/pwsh'
50 AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
53 Execute(Other shells should be used when set):
55 let &shell = '/bin/bash'
56 let &shellcmdflag = '-c'
57 let g:ale_shell = &shell
59 AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
62 Execute(cmd /s/c as a string should be used on Windows):
64 let &shell = 'who cares'
65 let &shellcmdflag = 'whatever'
67 AssertEqual 'cmd /s/c "foobar"', ale#job#PrepareCommand(bufnr(''), 'foobar')
70 Execute(Setting g:ale_shell should cause ale#job#PrepareCommand to use set shell):
71 let g:ale_shell = '/foo/bar'
74 AssertEqual ['/foo/bar', '/c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
76 AssertEqual ['/foo/bar', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
79 let g:ale_shell_arguments = '-x'
81 AssertEqual ['/foo/bar', '-x', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
83 Execute(Setting b:ale_shell should cause ale#job#PrepareCommand to use set shell):
84 let g:ale_shell = '/wrong/foo/bar'
85 let b:ale_shell = '/foo/bar'
88 AssertEqual ['/foo/bar', '/c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
90 AssertEqual ['/foo/bar', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
93 let g:ale_shell_arguments = '--verbose -x'
94 let b:ale_shell_arguments = '-x'
96 AssertEqual ['/foo/bar', '-x', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")