Get more random tests to pass on Windows

This commit is contained in:
w0rp 2017-10-08 23:26:50 +01:00
parent 65aa88a7d5
commit a809c4fa3a
12 changed files with 270 additions and 139 deletions

View File

@ -50,5 +50,5 @@ function! ale#test#SetFilename(path) abort
\ ? a:path \ ? a:path
\ : l:dir . '/' . a:path \ : l:dir . '/' . a:path
silent noautocmd execute 'file ' . fnameescape(ale#path#Winify(l:full_path)) silent! noautocmd execute 'file ' . fnameescape(ale#path#Winify(l:full_path))
endfunction endfunction

View File

@ -6,13 +6,11 @@ Before:
runtime ale_linters/erlang/syntaxerl.vim runtime ale_linters/erlang/syntaxerl.vim
After: After:
Restore Restore
call ale#linter#Reset() call ale#linter#Reset()
Execute (The executable should be correct): Execute (The executable should be correct):
AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr('')) AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
@ -25,22 +23,32 @@ Execute (The executable should be correct):
Execute (The executable should be presented in the feature check command): Execute (The executable should be presented in the feature check command):
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl' let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
AssertEqual "'/some/other/syntaxerl' -h", ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
AssertEqual
\ ale#Escape('/some/other/syntaxerl') . ' -h',
\ ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl' let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
AssertEqual "'/yet/another/syntaxerl' -h", ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
AssertEqual
\ ale#Escape('/yet/another/syntaxerl') . ' -h',
\ ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
Execute (The executable should be presented in the command): Execute (The executable should be presented in the command):
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl' let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
AssertEqual "'/some/other/syntaxerl' %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [])
AssertEqual
\ ale#Escape('/some/other/syntaxerl') . ' %t',
\ ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [])
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl' let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
AssertEqual "'/yet/another/syntaxerl' %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [])
AssertEqual
\ ale#Escape('/yet/another/syntaxerl') . ' %t',
\ ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [])
Execute (The -b option should be used when available): Execute (The -b option should be used when available):
AssertEqual "'syntaxerl' %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [ AssertEqual ale#Escape('syntaxerl') . ' %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [
\ 'Syntax checker for Erlang (0.14.0)', \ 'Syntax checker for Erlang (0.14.0)',
\ 'Usage: syntaxerl [-d | --debug] <FILENAME>', \ 'Usage: syntaxerl [-d | --debug] <FILENAME>',
\ ' syntaxerl <-h | --help>', \ ' syntaxerl <-h | --help>',
@ -48,7 +56,7 @@ Execute (The -b option should be used when available):
\ ' -h, --help Show this message', \ ' -h, --help Show this message',
\ ]) \ ])
AssertEqual "'syntaxerl' -b %s %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [ AssertEqual ale#Escape('syntaxerl') . ' -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [
\ 'Syntax checker for Erlang (0.14.0)', \ 'Syntax checker for Erlang (0.14.0)',
\ 'Usage: syntaxerl [-b | --base <FILENAME>] [-d | --debug] <FILENAME>', \ 'Usage: syntaxerl [-b | --base <FILENAME>] [-d | --debug] <FILENAME>',
\ ' syntaxerl <-h | --help>', \ ' syntaxerl <-h | --help>',

View File

@ -8,6 +8,8 @@ Before:
unlet! g:ale_python_flake8_options unlet! g:ale_python_flake8_options
unlet! g:ale_python_flake8_use_global unlet! g:ale_python_flake8_use_global
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
runtime ale_linters/python/flake8.vim runtime ale_linters/python/flake8.vim
call ale#test#SetDirectory('/testplugin/test/command_callback') call ale#test#SetDirectory('/testplugin/test/command_callback')
@ -16,6 +18,9 @@ After:
unlet! g:ale_python_flake8_args unlet! g:ale_python_flake8_args
unlet! b:bin_dir
unlet! b:executable
call ale#test#RestoreDirectory() call ale#test#RestoreDirectory()
call ale#linter#Reset() call ale#linter#Reset()
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
@ -25,26 +30,29 @@ Execute(The flake8 callbacks should return the correct default values):
\ 'flake8', \ 'flake8',
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''flake8'' --version', \ ale#Escape('flake8') . ' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''flake8'' --format=default --stdin-display-name %s -', \ ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
" Try with older versions. " Try with older versions.
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
AssertEqual AssertEqual
\ '''flake8'' --format=default -', \ ale#Escape('flake8') . ' --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(The flake8 command callback should let you set options): Execute(The flake8 command callback should let you set options):
let g:ale_python_flake8_options = '--some-option' let g:ale_python_flake8_options = '--some-option'
AssertEqual AssertEqual
\ '''flake8'' --some-option --format=default --stdin-display-name %s -', \ ale#Escape('flake8')
\ . ' --some-option --format=default'
\ . ' --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4'])
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
AssertEqual AssertEqual
\ '''flake8'' --some-option --format=default -', \ ale#Escape('flake8')
\ . ' --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(You should be able to set a custom executable and it should be escaped): Execute(You should be able to set a custom executable and it should be escaped):
@ -54,23 +62,29 @@ Execute(You should be able to set a custom executable and it should be escaped):
\ 'executable with spaces', \ 'executable with spaces',
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''executable with spaces'' --version', \ ale#Escape('executable with spaces') . ' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''executable with spaces'' --format=default --stdin-display-name %s -', \ ale#Escape('executable with spaces')
\ . ' --format=default'
\ . ' --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
Execute(The flake8 callbacks should detect virtualenv directories): Execute(The flake8 callbacks should detect virtualenv directories):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/flake8'
\)
AssertEqual AssertEqual
\ g:dir . '/python_paths/with_virtualenv/env/bin/flake8', \ b:executable,
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8'' --version', \ ale#Escape(b:executable) . ' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8''' \ ale#Escape(b:executable)
\ . ' --format=default --stdin-display-name %s -', \ . ' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
@ -78,35 +92,35 @@ Execute(The FindProjectRoot should detect the project root directory for namespa
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py')
AssertEqual AssertEqual
\ fnameescape(g:dir . '/python_paths/namespace_package_manifest'), \ ale#path#Winify(g:dir . '/python_paths/namespace_package_manifest'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf): Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_setup/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_setup/namespace/foo/bar.py')
AssertEqual AssertEqual
\ fnameescape(g:dir . '/python_paths/namespace_package_setup'), \ ale#path#Winify(g:dir . '/python_paths/namespace_package_setup'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini): Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_pytest/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_pytest/namespace/foo/bar.py')
AssertEqual AssertEqual
\ fnameescape(g:dir . '/python_paths/namespace_package_pytest'), \ ale#path#Winify(g:dir . '/python_paths/namespace_package_pytest'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini): Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py')
AssertEqual AssertEqual
\ fnameescape(g:dir . '/python_paths/namespace_package_tox'), \ ale#path#Winify(g:dir . '/python_paths/namespace_package_tox'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for non-namespace package): Execute(The FindProjectRoot should detect the project root directory for non-namespace package):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ fnameescape(g:dir . '/python_paths/no_virtualenv/subdir'), \ ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
" Some users currently run flake8 this way, so we should support it. " Some users currently run flake8 this way, so we should support it.
@ -120,10 +134,10 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ 'python', \ 'python',
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --version', \ ale#Escape('python') . ' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --some-option --format=default -', \ ale#Escape('python') . ' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
@ -135,10 +149,10 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ 'python', \ 'python',
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --version', \ ale#Escape('python') . ' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --some-option --format=default -', \ ale#Escape('python') . ' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(Using `python2 -m flake8` should be use with the old args option): Execute(Using `python2 -m flake8` should be use with the old args option):
@ -157,8 +171,8 @@ Execute(Using `python2 -m flake8` should be use with the old args option):
\ 'python2', \ 'python2',
\ ale_linters#python#flake8#GetExecutable(bufnr('')) \ ale_linters#python#flake8#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''python2'' -m flake8 --version', \ ale#Escape('python2') . ' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''python2'' -m flake8 --format=default -', \ ale#Escape('python2') . ' -m flake8 --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])

View File

@ -1,24 +1,34 @@
Before: Before:
Save g:ale_fuse_fusionlint_options
Save g:ale_fuse_fusionlint_executable
unlet! g:ale_fuse_fusionlint_options
unlet! g:ale_fuse_fusionlint_executable
runtime ale_linters/fuse/fusionlint.vim runtime ale_linters/fuse/fusionlint.vim
After: After:
Restore
call ale#linter#Reset() call ale#linter#Reset()
let g:ale_fuse_fusionlint_options = ''
let g:ale_fuse_fusionlint_executable = 'fusion-lint'
Execute(The fuse fusionlint command callback should return the correct default string): Execute(The fuse fusionlint command callback should return the correct default string):
AssertEqual '''fusion-lint'' --filename %s -i', AssertEqual ale#Escape('fusion-lint') . ' --filename %s -i',
\ join(split(ale_linters#fuse#fusionlint#GetCommand(1))) \ join(split(ale_linters#fuse#fusionlint#GetCommand(1)))
Execute(The fuse fusionlint command callback should let you set options): Execute(The fuse fusionlint command callback should let you set options):
let g:ale_fuse_fusionlint_options = '--example-option argument' let g:ale_fuse_fusionlint_options = '--example-option argument'
AssertEqual '''fusion-lint'' --example-option argument --filename %s -i', AssertEqual
\ ale#Escape('fusion-lint')
\ . ' --example-option argument --filename %s -i',
\ join(split(ale_linters#fuse#fusionlint#GetCommand(1))) \ join(split(ale_linters#fuse#fusionlint#GetCommand(1)))
Execute(The fusionlint executable should be configurable): Execute(The fusionlint executable should be configurable):
let g:ale_fuse_fusionlint_executable = 'util/linter.fuse' let g:ale_fuse_fusionlint_executable = 'util/linter.fuse'
AssertEqual 'util/linter.fuse', ale_linters#fuse#fusionlint#GetExecutable(1) AssertEqual 'util/linter.fuse', ale_linters#fuse#fusionlint#GetExecutable(1)
AssertEqual '''util/linter.fuse'' --filename %s -i', AssertEqual
\ ale#Escape('util/linter.fuse')
\ . ' --filename %s -i',
\ join(split(ale_linters#fuse#fusionlint#GetCommand(1))) \ join(split(ale_linters#fuse#fusionlint#GetCommand(1)))

View File

@ -1,97 +1,151 @@
Before: Before:
call ale#test#SetDirectory('/testplugin/test/command_callback')
Save g:ale_java_javac_options
Save g:ale_java_javac_classpath
unlet! g:ale_java_javac_options
unlet! g:ale_java_javac_classpath
let g:cp_sep = has('unix') ? ':' : ';'
function! GetCommand(previous_output) abort
let l:command = ale_linters#java#javac#GetCommand(
\ bufnr(''),
\ a:previous_output
\)
let l:split_command = split(l:command)
let l:index = index(l:split_command, '-d')
let l:split_command[l:index + 1] = 'TEMP'
return join(l:split_command)
endfunction
runtime ale_linters/java/javac.vim runtime ale_linters/java/javac.vim
call ale#engine#InitBufferInfo(bufnr('')) call ale#engine#InitBufferInfo(bufnr(''))
silent! cd /testplugin/test/command_callback call ale#test#SetFilename('dummy.java')
After: After:
call ale#test#RestoreDirectory()
Restore
unlet! g:cp_sep
delfunction GetCommand
call ale#linter#Reset() call ale#linter#Reset()
" We need to clean up the buffer to remove the temporary directories created " We need to clean up the buffer to remove the temporary directories created
" for the command. " for the command.
call ale#engine#Cleanup(bufnr('')) call ale#engine#Cleanup(bufnr(''))
let g:ale_java_javac_options = ''
let g:ale_java_javac_classpath = ''
Execute(The javac callback should return the correct default value): Execute(The javac callback should return the correct default value):
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), []) AssertEqual 'javac -Xlint -d TEMP %t', GetCommand([])
Assert match(b:command, '\v^javac +-Xlint +-d +''/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0,
\ 'Invalid command string: ' . b:command
Execute(The javac callback should use g:ale_java_javac_classpath correctly): Execute(The javac callback should use g:ale_java_javac_classpath correctly):
let g:ale_java_javac_classpath = 'foo.jar' let g:ale_java_javac_classpath = 'foo.jar'
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), []) AssertEqual
\ 'javac -Xlint'
Assert match(b:command, '\v^javac +-Xlint +-cp ''+foo\.jar'' +-d ''+/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, \ . ' -cp ' . ale#Escape('foo.jar')
\ 'Invalid command string: ' . b:command \ . ' -d TEMP %t',
\ GetCommand([])
Execute(The javac callback should include discovered classpaths): Execute(The javac callback should include discovered classpaths):
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ AssertEqual
\ '[DEBUG] Ignore this.', \ 'javac -Xlint -cp '
\ '[INFO] Something we should ignore.', \ . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
\ '/foo/bar.jar', \ . ' -d TEMP %t',
\ '/xyz/abc.jar', \ GetCommand([
\]) \ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
Assert match(b:command, '\v^javac +-Xlint +-cp ''+/foo/bar\.jar:/xyz/abc\.jar'' +-d +''/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, \ '/foo/bar.jar',
\ 'Invalid command string: ' . b:command \ '/xyz/abc.jar',
\ ])
Execute(The javac callback should combine discovered classpaths and manual ones): Execute(The javac callback should combine discovered classpaths and manual ones):
let g:ale_java_javac_classpath = 'configured.jar' let g:ale_java_javac_classpath = 'configured.jar'
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ AssertEqual
\ '[DEBUG] Ignore this.', \ 'javac -Xlint -cp '
\ '[INFO] Something we should ignore.', \ . ale#Escape(join(
\ '/foo/bar.jar', \ [
\ '/xyz/abc.jar', \ '/foo/bar.jar',
\]) \ '/xyz/abc.jar',
\ 'configured.jar',
\ ],
\ g:cp_sep
\ ))
\ . ' -d TEMP %t',
\ GetCommand([
\ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
\ ])
Assert match(b:command, '\v^javac +-Xlint +-cp +''/foo/bar\.jar:/xyz/abc\.jar:configured\.jar'' +-d ''+/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, let g:ale_java_javac_classpath = 'configured.jar' . g:cp_sep . 'configured2.jar'
\ 'Invalid command string: ' . b:command
let g:ale_java_javac_classpath = 'configured.jar:configured2.jar' AssertEqual
\ 'javac -Xlint -cp '
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ \ . ale#Escape(join(
\ '[DEBUG] Ignore this.', \ [
\ '[INFO] Something we should ignore.', \ '/foo/bar.jar',
\ '/foo/bar.jar', \ '/xyz/abc.jar',
\ '/xyz/abc.jar', \ 'configured.jar',
\]) \ 'configured2.jar',
\ ],
Assert match(b:command, '\v^javac +-Xlint +-cp +''/foo/bar\.jar:/xyz/abc\.jar:configured\.jar:configured2\.jar'' +-d +''/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, \ g:cp_sep
\ 'Invalid command string: ' . b:command \ ))
\ . ' -d TEMP %t',
\ GetCommand([
\ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
\ ])
Execute(The javac callback should detect source directories): Execute(The javac callback should detect source directories):
call ale#engine#Cleanup(bufnr('')) call ale#engine#Cleanup(bufnr(''))
:e! java_paths/src/main/java/com/something/dummy :e! java_paths/src/main/java/com/something/dummy
call ale#engine#InitBufferInfo(bufnr('')) call ale#engine#InitBufferInfo(bufnr(''))
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), []) AssertEqual
\ 'javac -Xlint'
Assert match(b:command, '\v^javac +-Xlint +-sourcepath ''/.*java_paths/src/main/java/'' +-d +''/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, \ . ' -sourcepath ' . ale#Escape(
\ 'Invalid command string: ' . b:command \ ale#path#Winify(g:dir . '/java_paths/src/main/java/')
\ )
\ . ' -d TEMP %t',
\ GetCommand([])
Execute(The javac callback should combine detected source directories and classpaths): Execute(The javac callback should combine detected source directories and classpaths):
call ale#engine#Cleanup(bufnr('')) call ale#engine#Cleanup(bufnr(''))
:e! java_paths/src/main/java/com/something/dummy call ale#test#SetFilename('java_paths/src/main/java/com/something/dummy.java')
call ale#engine#InitBufferInfo(bufnr('')) call ale#engine#InitBufferInfo(bufnr(''))
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ AssertEqual
\ '[DEBUG] Ignore this.', \ 'javac -Xlint'
\ '[INFO] Something we should ignore.', \ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
\ '/foo/bar.jar', \ . ' -sourcepath ' . ale#Escape(
\ '/xyz/abc.jar', \ ale#path#Winify(g:dir . '/java_paths/src/main/java/')
\]) \ )
\ . ' -d TEMP %t',
Assert match(b:command, '\v^javac +-Xlint +-cp +''/foo/bar\.jar:/xyz/abc\.jar'' +-sourcepath ''/.*java_paths/src/main/java/'' +-d +''/tmp/[0-9a-zA-Z/]+'' +\%t$') >= 0, \ GetCommand([
\ 'Invalid command string: ' . b:command \ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
\ ])
Execute(The javac callback should use g:ale_java_javac_options correctly): Execute(The javac callback should use g:ale_java_javac_options correctly):
let g:ale_java_javac_options = '--anything --else' let g:ale_java_javac_options = '--anything --else'
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), []) let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [])
Assert match(b:command, '\v^javac +-Xlint +-d +''/tmp/[0-9a-zA-Z/]+'' --anything --else +\%t$') >= 0, AssertEqual
\ 'Invalid command string: ' . b:command \ 'javac -Xlint'
\ . ' -d TEMP --anything --else %t',
\ GetCommand([])

View File

@ -7,19 +7,19 @@ After:
Execute(Should return the correct default values): Execute(Should return the correct default values):
AssertEqual AssertEqual
\ 'jscs', \ 'jscs',
\ ale_linters#javascript#jscs#GetExecutable(bufnr('')) \ ale_linters#javascript#jscs#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''jscs'' --reporter inline --no-colors -', \ ale#Escape('jscs') . ' --reporter inline --no-colors -',
\ ale_linters#javascript#jscs#GetCommand(bufnr('')) \ ale_linters#javascript#jscs#GetCommand(bufnr(''))
Execute(Should allow using a custom executable): Execute(Should allow using a custom executable):
let g:ale_javascript_jscs_executable = 'foobar' let g:ale_javascript_jscs_executable = 'foobar'
AssertEqual AssertEqual
\ 'foobar', \ 'foobar',
\ ale_linters#javascript#jscs#GetExecutable(bufnr('')) \ ale_linters#javascript#jscs#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''foobar'' --reporter inline --no-colors -', \ ale#Escape('foobar') . ' --reporter inline --no-colors -',
\ ale_linters#javascript#jscs#GetCommand(bufnr('')) \ ale_linters#javascript#jscs#GetCommand(bufnr(''))

View File

@ -7,18 +7,18 @@ After:
let g:ale_lua_luacheck_executable = 'luacheck' let g:ale_lua_luacheck_executable = 'luacheck'
Execute(The lua luacheck command callback should return the correct default string): Execute(The lua luacheck command callback should return the correct default string):
AssertEqual '''luacheck'' --formatter plain --codes --filename %s -', AssertEqual ale#Escape('luacheck') . ' --formatter plain --codes --filename %s -',
\ join(split(ale_linters#lua#luacheck#GetCommand(1))) \ join(split(ale_linters#lua#luacheck#GetCommand(1)))
Execute(The lua luacheck command callback should let you set options): Execute(The lua luacheck command callback should let you set options):
let g:ale_lua_luacheck_options = '--config filename' let g:ale_lua_luacheck_options = '--config filename'
AssertEqual '''luacheck'' --config filename --formatter plain --codes --filename %s -', AssertEqual ale#Escape('luacheck') . ' --config filename --formatter plain --codes --filename %s -',
\ join(split(ale_linters#lua#luacheck#GetCommand(1))) \ join(split(ale_linters#lua#luacheck#GetCommand(1)))
Execute(The luacheck executable should be configurable): Execute(The luacheck executable should be configurable):
let g:ale_lua_luacheck_executable = 'luacheck.sh' let g:ale_lua_luacheck_executable = 'luacheck.sh'
AssertEqual 'luacheck.sh', ale_linters#lua#luacheck#GetExecutable(1) AssertEqual 'luacheck.sh', ale_linters#lua#luacheck#GetExecutable(1)
AssertEqual '''luacheck.sh'' --formatter plain --codes --filename %s -', AssertEqual ale#Escape('luacheck.sh') . ' --formatter plain --codes --filename %s -',
\ join(split(ale_linters#lua#luacheck#GetCommand(1))) \ join(split(ale_linters#lua#luacheck#GetCommand(1)))

View File

@ -1,20 +1,35 @@
Before: Before:
Save g:ale_python_mypy_executable
Save g:ale_python_mypy_options
Save g:ale_python_mypy_use_global
unlet! g:ale_python_mypy_executable
unlet! g:ale_python_mypy_options
unlet! g:ale_python_mypy_use_global
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
runtime ale_linters/python/mypy.vim runtime ale_linters/python/mypy.vim
call ale#test#SetDirectory('/testplugin/test/command_callback') call ale#test#SetDirectory('/testplugin/test/command_callback')
call ale#test#SetFilename('test.py')
After: After:
Restore
unlet! b:bin_dir
unlet! b:executable
call ale#test#RestoreDirectory() call ale#test#RestoreDirectory()
call ale#linter#Reset() call ale#linter#Reset()
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_options = ''
let g:ale_python_mypy_use_global = 0
Execute(The mypy callbacks should return the correct default values): Execute(The mypy callbacks should return the correct default values):
AssertEqual AssertEqual
\ 'mypy', \ 'mypy',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ''' . g:dir . ''' && ''mypy'' --show-column-numbers ' \ 'cd ' . ale#Escape(g:dir) . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))
@ -25,7 +40,8 @@ Execute(The mypy executable should be configurable, and escaped properly):
\ 'executable with spaces', \ 'executable with spaces',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ''' . g:dir . ''' && ''executable with spaces'' --show-column-numbers ' \ 'cd ' . ale#Escape(g:dir) . ' && ' . ale#Escape('executable with spaces')
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))
@ -33,7 +49,8 @@ Execute(The mypy command callback should let you set options):
let g:ale_python_mypy_options = '--some-option' let g:ale_python_mypy_options = '--some-option'
AssertEqual AssertEqual
\ 'cd ''' . g:dir . ''' && ''mypy'' --show-column-numbers --some-option ' \ 'cd ' . ale#Escape(g:dir) . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers --some-option '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))
@ -44,19 +61,24 @@ Execute(The mypy command should switch directories to the detected project root)
\ 'mypy', \ 'mypy',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ''' . g:dir . '/python_paths/no_virtualenv/subdir'' && ''mypy'' --show-column-numbers ' \ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir'))
\ . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))
Execute(The mypy callbacks should detect virtualenv directories and switch to the project root): Execute(The mypy callbacks should detect virtualenv directories and switch to the project root):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy')
AssertEqual AssertEqual
\ g:dir . '/python_paths/with_virtualenv/env/bin/mypy', \ b:executable,
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ''' . g:dir . '/python_paths/with_virtualenv/subdir'' && ''' \ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir'))
\ . g:dir . '/python_paths/with_virtualenv/env/bin/mypy'' --show-column-numbers ' \ . ' && ' . ale#Escape(b:executable)
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))
@ -68,6 +90,8 @@ Execute(You should able able to use the global mypy instead):
\ 'mypy', \ 'mypy',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ''' . g:dir . '/python_paths/with_virtualenv/subdir'' && ''mypy'' --show-column-numbers ' \ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir'))
\ . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
\ ale_linters#python#mypy#GetCommand(bufnr('')) \ ale_linters#python#mypy#GetCommand(bufnr(''))

View File

@ -33,13 +33,13 @@ Execute(Vendor executables should be detected):
call ale#test#SetFilename('php-langserver-project/test.php') call ale#test#SetFilename('php-langserver-project/test.php')
AssertEqual AssertEqual
\ g:dir . '/php-langserver-project/vendor/bin/php-language-server.php', \ ale#path#Winify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'),
\ ale_linters#php#langserver#GetExecutable(bufnr('')) \ ale_linters#php#langserver#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'php ' . ale#Escape( \ 'php ' . ale#Escape(ale#path#Winify(
\ g:dir \ g:dir
\ . '/php-langserver-project/vendor/bin/php-language-server.php' \ . '/php-langserver-project/vendor/bin/php-language-server.php'
\ ), \ )),
\ ale_linters#php#langserver#GetCommand(bufnr('')) \ ale_linters#php#langserver#GetCommand(bufnr(''))
Execute(The language string should be correct): Execute(The language string should be correct):

View File

@ -21,11 +21,12 @@ Execute(puglint should detect local executables and package.json):
call ale#test#SetFilename('puglint_project/test.pug') call ale#test#SetFilename('puglint_project/test.pug')
AssertEqual AssertEqual
\ g:dir . '/puglint_project/node_modules/.bin/pug-lint', \ ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
\ ale_linters#pug#puglint#GetExecutable(bufnr('')) \ ale_linters#pug#puglint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ale#Escape(g:dir . '/puglint_project/node_modules/.bin/pug-lint') \ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(g:dir . '/puglint_project/package.json') \ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -35,9 +36,10 @@ Execute(puglint should use global executables if configured):
call ale#test#SetFilename('puglint_project/test.pug') call ale#test#SetFilename('puglint_project/test.pug')
AssertEqual 'pug-lint', ale_linters#pug#puglint#GetExecutable(bufnr('')) AssertEqual 'pug-lint', ale_linters#pug#puglint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ale#Escape('pug-lint') \ ale#Escape('pug-lint')
\ . ' -c ' . ale#Escape(g:dir . '/puglint_project/package.json') \ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -45,8 +47,8 @@ Execute(puglint should detect .pug-lintrc):
call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(g:dir . '/puglint_project/node_modules/.bin/pug-lint') \ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc') \ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -54,8 +56,8 @@ Execute(puglint should detect .pug-lintrc.js):
call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(g:dir . '/puglint_project/node_modules/.bin/pug-lint') \ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js') \ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -63,7 +65,7 @@ Execute(puglint should detect .pug-lintrc.json):
call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(g:dir . '/puglint_project/node_modules/.bin/pug-lint') \ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json') \ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))

View File

@ -9,15 +9,17 @@ After:
Restore Restore
Execute(The pycodestyle command callback should return default string): Execute(The pycodestyle command callback should return default string):
AssertEqual '''pycodestyle'' -', AssertEqual ale#Escape('pycodestyle') . ' -',
\ ale_linters#python#pycodestyle#GetCommand(bufnr('')) \ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
Execute(The pycodestyle command callback should allow options): Execute(The pycodestyle command callback should allow options):
let g:ale_python_pycodestyle_options = '--exclude=test*.py' let g:ale_python_pycodestyle_options = '--exclude=test*.py'
AssertEqual '''pycodestyle'' --exclude=test*.py -',
AssertEqual ale#Escape('pycodestyle') . ' --exclude=test*.py -',
\ ale_linters#python#pycodestyle#GetCommand(bufnr('')) \ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
Execute(The pycodestyle executable should be configurable): Execute(The pycodestyle executable should be configurable):
let g:ale_python_pycodestyle_executable = '~/.local/bin/pycodestyle' let g:ale_python_pycodestyle_executable = '~/.local/bin/pycodestyle'
AssertEqual '''~/.local/bin/pycodestyle'' -',
AssertEqual ale#Escape('~/.local/bin/pycodestyle') . ' -',
\ ale_linters#python#pycodestyle#GetCommand(bufnr('')) \ ale_linters#python#pycodestyle#GetCommand(bufnr(''))

View File

@ -1,22 +1,34 @@
Before: Before:
Save g:ale_python_pylint_executable
Save g:ale_python_pylint_options
Save g:ale_python_pylint_use_global
unlet! g:ale_python_pylint_executable
unlet! g:ale_python_pylint_options
unlet! g:ale_python_pylint_use_global
runtime ale_linters/python/pylint.vim runtime ale_linters/python/pylint.vim
call ale#test#SetDirectory('/testplugin/test/command_callback') call ale#test#SetDirectory('/testplugin/test/command_callback')
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
let b:command_tail = ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n %s' let b:command_tail = ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n %s'
After: After:
Restore
call ale#test#RestoreDirectory() call ale#test#RestoreDirectory()
call ale#linter#Reset() call ale#linter#Reset()
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = '' unlet! b:bin_dir
let g:ale_python_pylint_use_global = 0 unlet! b:executable
Execute(The pylint callbacks should return the correct default values): Execute(The pylint callbacks should return the correct default values):
AssertEqual AssertEqual
\ 'pylint', \ 'pylint',
\ ale_linters#python#pylint#GetExecutable(bufnr('')) \ ale_linters#python#pylint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''pylint'' ' . b:command_tail, \ ale#Escape('pylint') . ' ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))
Execute(The pylint executable should be configurable, and escaped properly): Execute(The pylint executable should be configurable, and escaped properly):
@ -26,14 +38,14 @@ Execute(The pylint executable should be configurable, and escaped properly):
\ 'executable with spaces', \ 'executable with spaces',
\ ale_linters#python#pylint#GetExecutable(bufnr('')) \ ale_linters#python#pylint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''executable with spaces'' ' . b:command_tail, \ ale#Escape('executable with spaces') . ' ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))
Execute(The pylint command callback should let you set options): Execute(The pylint command callback should let you set options):
let g:ale_python_pylint_options = '--some-option' let g:ale_python_pylint_options = '--some-option'
AssertEqual AssertEqual
\ '''pylint'' --some-option' . b:command_tail, \ ale#Escape('pylint') . ' --some-option' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))
Execute(The pylint callbacks shouldn't detect virtualenv directories where they don't exist): Execute(The pylint callbacks shouldn't detect virtualenv directories where they don't exist):
@ -43,17 +55,22 @@ Execute(The pylint callbacks shouldn't detect virtualenv directories where they
\ 'pylint', \ 'pylint',
\ ale_linters#python#pylint#GetExecutable(bufnr('')) \ ale_linters#python#pylint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''pylint'' ' . b:command_tail, \ ale#Escape('pylint') . ' ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))
Execute(The pylint callbacks should detect virtualenv directories): Execute(The pylint callbacks should detect virtualenv directories):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylint'
\)
AssertEqual AssertEqual
\ g:dir . '/python_paths/with_virtualenv/env/bin/pylint', \ b:executable,
\ ale_linters#python#pylint#GetExecutable(bufnr('')) \ ale_linters#python#pylint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ''''. g:dir . '/python_paths/with_virtualenv/env/bin/pylint'' ' . b:command_tail, \ ale#Escape(b:executable) . ' ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))
Execute(You should able able to use the global pylint instead): Execute(You should able able to use the global pylint instead):
@ -64,5 +81,5 @@ Execute(You should able able to use the global pylint instead):
\ 'pylint', \ 'pylint',
\ ale_linters#python#pylint#GetExecutable(bufnr('')) \ ale_linters#python#pylint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ '''pylint'' ' . b:command_tail, \ ale#Escape('pylint') . ' ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr('')) \ ale_linters#python#pylint#GetCommand(bufnr(''))