Fix the mscs tests on Windows, and use the improved Simplify for all tests instead.
This commit is contained in:
parent
73f61514c9
commit
1568bf8128
68 changed files with 224 additions and 241 deletions
|
@ -17,23 +17,6 @@ function! ale#path#Simplify(path) abort
|
|||
return substitute(simplify(l:win_path), '^\\\+', '\', 'g') " no-custom-checks
|
||||
endfunction
|
||||
|
||||
" This function is mainly used for testing.
|
||||
"
|
||||
" If an additional 'add_drive' argument is given, the current drive letter
|
||||
" will be prefixed to any absolute paths on Windows.
|
||||
function! ale#path#Winify(path, ...) abort
|
||||
let l:new_path = ale#path#Simplify(a:path)
|
||||
|
||||
if has('win32')
|
||||
" Add a drive letter to \foo\bar paths, if needed.
|
||||
if a:0 && a:1 is# 'add_drive' && l:new_path[:0] is# '\'
|
||||
let l:new_path = fnamemodify('.', ':p')[:1] . l:new_path
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:new_path
|
||||
endfunction
|
||||
|
||||
" Given a buffer and a filename, find the nearest file by searching upwards
|
||||
" through the paths relative to the given buffer.
|
||||
function! ale#path#FindNearestFile(buffer, filename) abort
|
||||
|
|
|
@ -50,5 +50,5 @@ function! ale#test#SetFilename(path) abort
|
|||
\ ? a:path
|
||||
\ : l:dir . '/' . a:path
|
||||
|
||||
silent! noautocmd execute 'file ' . fnameescape(ale#path#Winify(l:full_path))
|
||||
silent! noautocmd execute 'file ' . fnameescape(ale#path#Simplify(l:full_path))
|
||||
endfunction
|
||||
|
|
|
@ -25,7 +25,7 @@ Execute(The brakeman command callback should find a valid Rails app root):
|
|||
|
||||
AssertEqual
|
||||
\ 'brakeman -f json -q -p '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app')),
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')),
|
||||
\ ale_linters#ruby#brakeman#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The brakeman command callback should include configured options):
|
||||
|
@ -35,5 +35,5 @@ Execute(The brakeman command callback should include configured options):
|
|||
|
||||
AssertEqual
|
||||
\ 'brakeman -f json -q --combobulate -p '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app')),
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')),
|
||||
\ ale_linters#ruby#brakeman#GetCommand(bufnr(''))
|
||||
|
|
|
@ -43,7 +43,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
|
|||
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
||||
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/cppcheck_paths/one')) . ' && '
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) . ' && '
|
||||
\ . ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c --project=compile_commands.json --enable=style %t',
|
||||
\ ale_linters#c#cppcheck#GetCommand(bufnr(''))
|
||||
|
|
|
@ -43,7 +43,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
|
|||
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
||||
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/cppcheck_paths/one')) . ' && '
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) . ' && '
|
||||
\ . ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c++ --project=compile_commands.json --enable=style %t',
|
||||
\ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))
|
||||
|
|
|
@ -35,6 +35,6 @@ Execute(The .packages file should be set if detected):
|
|||
|
||||
AssertEqual
|
||||
\ ale#Escape('dartanalyzer')
|
||||
\ . ' --packages ' . ale#Escape(ale#path#Winify(g:dir . '/dart_paths/.packages'))
|
||||
\ . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/dart_paths/.packages'))
|
||||
\ . ' %s',
|
||||
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
||||
|
|
|
@ -76,7 +76,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
|
|||
Execute(The flake8 callbacks should detect virtualenv directories):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/flake8'
|
||||
\)
|
||||
|
||||
|
@ -95,35 +95,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')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_manifest'),
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_manifest'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
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')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_setup'),
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_setup'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
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')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_pytest'),
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_pytest'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
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')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_tox'),
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_tox'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
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')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir'),
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
" Some users currently run flake8 this way, so we should support it.
|
||||
|
|
|
@ -18,7 +18,7 @@ Execute(The default command should be correct):
|
|||
|
||||
Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
|
||||
call ale#test#SetFilename('../hamllint-test-files/rubocop-yml/subdir/file.haml')
|
||||
let b:conf = ale#path#Winify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml')
|
||||
let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml')
|
||||
|
||||
if has('win32')
|
||||
" Windows uses 'set var=... && command'
|
||||
|
@ -38,7 +38,7 @@ Execute(The command should have the .rubocop.yml prepended as an env var if one
|
|||
|
||||
Execute(The command should have the nearest .haml-lint.yml set as --config if it exists):
|
||||
call ale#test#SetFilename('../hamllint-test-files/haml-lint-yml/subdir/file.haml')
|
||||
let b:conf = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml')
|
||||
let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml')
|
||||
|
||||
AssertEqual
|
||||
\ 'haml-lint --config '
|
||||
|
@ -48,8 +48,8 @@ Execute(The command should have the nearest .haml-lint.yml set as --config if it
|
|||
|
||||
Execute(The command should include a .rubocop.yml and a .haml-lint if both are found):
|
||||
call ale#test#SetFilename('../hamllint-test-files/haml-lint-and-rubocop/subdir/file.haml')
|
||||
let b:conf_hamllint = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.haml-lint.yml')
|
||||
let b:conf_rubocop = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.rubocop.yml')
|
||||
let b:conf_hamllint = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.haml-lint.yml')
|
||||
let b:conf_rubocop = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.rubocop.yml')
|
||||
|
||||
if has('win32')
|
||||
" Windows uses 'set var=... && command'
|
||||
|
|
|
@ -122,7 +122,7 @@ Execute(The javac callback should detect source directories):
|
|||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/')
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
|
||||
\ )
|
||||
\ . ' -d TEMP %t',
|
||||
\ GetCommand([])
|
||||
|
@ -136,7 +136,7 @@ Execute(The javac callback should combine detected source directories and classp
|
|||
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
|
||||
\ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/')
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
|
||||
\ )
|
||||
\ . ' -d TEMP %t',
|
||||
\ GetCommand([
|
||||
|
@ -166,8 +166,8 @@ Execute(The javac callback should include src/test/java for test paths):
|
|||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Winify(g:dir . '/java_paths/src/test/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/test/java/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d TEMP %t',
|
||||
\ GetCommand([])
|
||||
|
@ -180,8 +180,8 @@ Execute(The javac callback should include src/main/jaxb when available):
|
|||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/java/'),
|
||||
\ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d TEMP %t',
|
||||
\ GetCommand([])
|
||||
|
|
|
@ -30,7 +30,7 @@ After:
|
|||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/stylelint_paths/node_modules/.bin/stylelint'
|
||||
\)
|
||||
|
|
|
@ -30,7 +30,7 @@ After:
|
|||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('lessc_paths/nested/testfile.less')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/lessc_paths/node_modules/.bin/lessc'
|
||||
\)
|
||||
|
@ -43,7 +43,7 @@ Execute(node_modules directories should be discovered):
|
|||
\ ale#Escape(b:executable)
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path='
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ' -',
|
||||
\ ale_linters#less#lessc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -61,7 +61,7 @@ Execute(The global override should work):
|
|||
\ ale#Escape('foobar')
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path='
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ' -',
|
||||
\ ale_linters#less#lessc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -76,7 +76,7 @@ Execute(Extra options should be configurable):
|
|||
\ ale#Escape('lessc')
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path='
|
||||
\ . ale#Escape(ale#path#Winify(g:dir))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir))
|
||||
\ . ' --whatever'
|
||||
\ . ' -',
|
||||
\ ale_linters#less#lessc#GetCommand(bufnr(''))
|
||||
|
|
|
@ -61,7 +61,7 @@ Execute(The mypy command should switch directories to the detected project root)
|
|||
\ 'mypy',
|
||||
\ ale_linters#python#mypy#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir'))
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'))
|
||||
\ . ' && ' . ale#Escape('mypy')
|
||||
\ . ' --show-column-numbers '
|
||||
\ . '--shadow-file %s %t %s',
|
||||
|
@ -70,13 +70,13 @@ Execute(The mypy command should switch directories to the detected 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')
|
||||
|
||||
let b:executable = ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy')
|
||||
|
||||
AssertEqual
|
||||
\ b:executable,
|
||||
\ ale_linters#python#mypy#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ . ' && ' . ale#Escape(b:executable)
|
||||
\ . ' --show-column-numbers '
|
||||
\ . '--shadow-file %s %t %s',
|
||||
|
@ -90,7 +90,7 @@ Execute(You should able able to use the global mypy instead):
|
|||
\ 'mypy',
|
||||
\ ale_linters#python#mypy#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ . ' && ' . ale#Escape('mypy')
|
||||
\ . ' --show-column-numbers '
|
||||
\ . '--shadow-file %s %t %s',
|
||||
|
|
|
@ -32,14 +32,14 @@ Execute(The project root should be detected correctly):
|
|||
call ale#test#SetFilename('ols_paths/file.ml')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/ols_paths'),
|
||||
\ ale#path#Simplify(g:dir . '/ols_paths'),
|
||||
\ ale#handlers#ols#GetProjectRoot(bufnr(''))
|
||||
|
||||
Execute(The local executable should be used when available):
|
||||
call ale#test#SetFilename('ols_paths/file.ml')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#handlers#ols#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(The gloabl executable should always be used when use_global is set):
|
||||
|
|
|
@ -43,7 +43,7 @@ Execute(The command should be correct with g:ale_perl_perlcritic_showrules on):
|
|||
Execute(The command search for the profile file when set):
|
||||
let b:ale_perl_perlcritic_profile = 'README.md'
|
||||
|
||||
let b:readme_path = ale#path#Winify(expand('%:p:h:h:h') . '/README.md')
|
||||
let b:readme_path = ale#path#Simplify(expand('%:p:h:h:h') . '/README.md')
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor'
|
||||
|
|
|
@ -33,10 +33,10 @@ Execute(Vendor executables should be detected):
|
|||
call ale#test#SetFilename('php-langserver-project/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'),
|
||||
\ ale#path#Simplify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'),
|
||||
\ ale_linters#php#langserver#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'php ' . ale#Escape(ale#path#Winify(
|
||||
\ 'php ' . ale#Escape(ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/php-langserver-project/vendor/bin/php-language-server.php'
|
||||
\ )),
|
||||
|
|
|
@ -21,12 +21,12 @@ Execute(puglint should detect local executables and package.json):
|
|||
call ale#test#SetFilename('puglint_project/test.pug')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ ale_linters#pug#puglint#GetExecutable(bufnr(''))
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
|
||||
\ . ' -r inline %t',
|
||||
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -39,7 +39,7 @@ Execute(puglint should use global executables if configured):
|
|||
|
||||
AssertEqual
|
||||
\ ale#Escape('pug-lint')
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
|
||||
\ . ' -r inline %t',
|
||||
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -47,8 +47,8 @@ Execute(puglint should detect .pug-lintrc):
|
|||
call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
|
||||
\ . ' -r inline %t',
|
||||
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -56,8 +56,8 @@ Execute(puglint should detect .pug-lintrc.js):
|
|||
call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
|
||||
\ . ' -r inline %t',
|
||||
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -65,7 +65,7 @@ Execute(puglint should detect .pug-lintrc.json):
|
|||
call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
|
||||
\ . ' -r inline %t',
|
||||
\ ale_linters#pug#puglint#GetCommand(bufnr(''))
|
||||
|
|
|
@ -33,7 +33,7 @@ Execute(The pyflakes executable should be configurable):
|
|||
Execute(The pyflakes executable should be run from the virtualenv path):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyflakes'
|
||||
\)
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ Execute(The pylint callbacks shouldn't detect virtualenv directories where they
|
|||
Execute(The pylint callbacks should detect virtualenv directories):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylint'
|
||||
\)
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ Execute(The pyls executable should be configurable):
|
|||
Execute(The pyls executable should be run from the virtualenv path):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyls'
|
||||
\)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ Before:
|
|||
|
||||
let b:args = '--silent -f json'
|
||||
\ . ' --output-file ' . (has('win32') ? '%t' : '/dev/stdout')
|
||||
let b:app_path = ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app')
|
||||
let b:app_path = ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')
|
||||
let b:suffix = has('win32') ? '; type %t' : ''
|
||||
|
||||
After:
|
||||
|
|
|
@ -32,14 +32,14 @@ Execute(The project root should be detected correctly):
|
|||
call ale#test#SetFilename('ols_paths/file.re')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/ols_paths'),
|
||||
\ ale#path#Simplify(g:dir . '/ols_paths'),
|
||||
\ ale#handlers#ols#GetProjectRoot(bufnr(''))
|
||||
|
||||
Execute(The local executable should be used when available):
|
||||
call ale#test#SetFilename('ols_paths/file.re')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#handlers#ols#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(The gloabl executable should always be used when use_global is set):
|
||||
|
|
|
@ -17,7 +17,7 @@ Execute(Executable should default to rubocop):
|
|||
AssertEqual
|
||||
\ ale#Escape('rubocop')
|
||||
\ . ' --format json --force-exclusion --stdin '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')),
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
|
||||
\ ale_linters#ruby#rubocop#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Should be able to set a custom executable):
|
||||
|
@ -26,7 +26,7 @@ Execute(Should be able to set a custom executable):
|
|||
AssertEqual
|
||||
\ ale#Escape('bin/rubocop')
|
||||
\ . ' --format json --force-exclusion --stdin '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')),
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
|
||||
\ ale_linters#ruby#rubocop#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Setting bundle appends 'exec rubocop'):
|
||||
|
@ -35,5 +35,5 @@ Execute(Setting bundle appends 'exec rubocop'):
|
|||
AssertEqual
|
||||
\ ale#Escape('path to/bundle') . ' exec rubocop'
|
||||
\ . ' --format json --force-exclusion --stdin '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')),
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
|
||||
\ ale_linters#ruby#rubocop#GetCommand(bufnr(''))
|
||||
|
|
|
@ -37,5 +37,5 @@ Execute(The project root should be detected correctly):
|
|||
call ale#test#SetFilename('rust-rls-project/test.rs')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/rust-rls-project'),
|
||||
\ ale#path#Simplify(g:dir . '/rust-rls-project'),
|
||||
\ ale_linters#rust#rls#GetProjectRoot(bufnr(''))
|
||||
|
|
|
@ -12,7 +12,7 @@ Before:
|
|||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||
call ale#test#SetFilename('test.sh')
|
||||
|
||||
let b:prefix = 'cd ' . ale#Escape(ale#path#Winify(g:dir)) . ' && '
|
||||
let b:prefix = 'cd ' . ale#Escape(ale#path#Simplify(g:dir)) . ' && '
|
||||
let b:suffix = ' -f gcc -'
|
||||
|
||||
After:
|
||||
|
|
|
@ -20,7 +20,7 @@ Execute(The default command should be correct):
|
|||
Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
|
||||
call ale#test#SetFilename('../slimlint-test-files/subdir/file.slim')
|
||||
|
||||
let b:conf = ale#path#Winify(g:dir . '/../slimlint-test-files/.rubocop.yml')
|
||||
let b:conf = ale#path#Simplify(g:dir . '/../slimlint-test-files/.rubocop.yml')
|
||||
|
||||
if has('win32')
|
||||
" Windows uses 'set var=... && command'
|
||||
|
|
|
@ -27,7 +27,7 @@ After:
|
|||
Execute(bin/cmd.js paths should be preferred):
|
||||
call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js'
|
||||
\)
|
||||
|
@ -45,7 +45,7 @@ Execute(bin/cmd.js paths should be preferred):
|
|||
Execute(.bin directories should be used too):
|
||||
call ale#test#SetFilename('standard-test-files/with-bin/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Winify(
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-bin/node_modules/.bin/standard'
|
||||
\)
|
||||
|
|
|
@ -34,10 +34,10 @@ Execute(The yaml swaglint command callback should allow a local installation to
|
|||
call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'),
|
||||
\ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'),
|
||||
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint')
|
||||
\ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint')
|
||||
\ . ' -r compact --stdin',
|
||||
\ ale_linters#yaml#swaglint#GetCommand(bufnr(''))
|
||||
|
|
|
@ -34,10 +34,10 @@ Execute(Should use the node_modules/.bin executable, if available):
|
|||
call ale#test#SetFilename('write-good-node-modules/test.txt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'),
|
||||
\ ale#path#Simplify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'),
|
||||
\ ale#handlers#writegood#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'))
|
||||
\ . ' %t',
|
||||
\ ale#handlers#writegood#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -45,11 +45,11 @@ Execute(Should use the node_modules/write-good executable, if available):
|
|||
call ale#test#SetFilename('write-good-node-modules-2/test.txt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'),
|
||||
\ ale#path#Simplify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'),
|
||||
\ ale#handlers#writegood#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'))
|
||||
\ . ' %t',
|
||||
\ ale#handlers#writegood#GetCommand(bufnr(''))
|
||||
|
||||
|
|
|
@ -515,7 +515,7 @@ Execute(ale#fix#InitBufferData() should set up the correct data):
|
|||
\ bufnr(''): {
|
||||
\ 'temporary_directory_list': [],
|
||||
\ 'vars': b:,
|
||||
\ 'filename': ale#path#Winify(getcwd() . '/fix_test_file'),
|
||||
\ 'filename': ale#path#Simplify(getcwd() . '/fix_test_file'),
|
||||
\ 'done': 0,
|
||||
\ 'lines_before': ['a', 'b', 'c'],
|
||||
\ 'should_save': 1,
|
||||
|
|
|
@ -27,7 +27,7 @@ Execute(The autopep8 callback should return the correct default values):
|
|||
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
|
||||
\ ale#fixers#autopep8#Fix(bufnr(''))
|
||||
|
||||
Execute(The autopep8 callback should include options):
|
||||
|
@ -35,5 +35,5 @@ Execute(The autopep8 callback should include options):
|
|||
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
|
||||
\ ale#fixers#autopep8#Fix(bufnr(''))
|
||||
|
|
|
@ -15,7 +15,7 @@ Execute(The elm-format command should have default params):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ . ' %t --yes',
|
||||
\ },
|
||||
\ ale#fixers#format#Fix(bufnr(''))
|
||||
|
@ -55,7 +55,7 @@ Execute(The elm-format command should manage empty options):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ . ' %t',
|
||||
\ },
|
||||
\ ale#fixers#format#Fix(bufnr(''))
|
||||
|
@ -68,7 +68,7 @@ Execute(The elm-format command should manage custom options):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
||||
\ . ' %t --param1 --param2',
|
||||
\ },
|
||||
\ ale#fixers#format#Fix(bufnr(''))
|
||||
|
|
|
@ -13,8 +13,8 @@ Execute(The executable path should be correct):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), ['v4.4.1 (eslint_d v5.1.0)'])
|
||||
|
@ -26,8 +26,8 @@ Execute(The lower priority configuration file in a nested directory should be pr
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/subdir-with-config/.eslintrc'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/subdir-with-config/.eslintrc'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
|
||||
|
@ -39,8 +39,8 @@ Execute(package.json should be used as a last resort):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
|
||||
|
@ -51,8 +51,8 @@ Execute(package.json should be used as a last resort):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/package.json'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
|
||||
|
@ -64,7 +64,7 @@ Execute(The version check should be correct):
|
|||
\ {
|
||||
\ 'chain_with': 'ale#fixers#eslint#ApplyFixForVersion',
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' --version'
|
||||
\ },
|
||||
\ ale#fixers#eslint#Fix(bufnr(''))
|
||||
|
@ -75,7 +75,7 @@ Execute(--fix-dry-run should be used for 4.9.0 and up):
|
|||
AssertEqual
|
||||
\ {
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
|
||||
\ },
|
||||
|
@ -88,8 +88,8 @@ Execute(--fix-to-stdout should be used for eslint_d):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/package.json'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [''])
|
||||
|
@ -99,7 +99,7 @@ Execute(--fix-to-stdout should be used for eslint_d):
|
|||
AssertEqual
|
||||
\ {
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ . ' --stdin-filename %s --stdin --fix-to-stdout',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
|
||||
\ },
|
||||
|
@ -109,7 +109,7 @@ Execute(--fix-to-stdout should be used for eslint_d):
|
|||
AssertEqual
|
||||
\ {
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
|
||||
\ . ' --stdin-filename %s --stdin --fix-to-stdout',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
|
||||
\ },
|
||||
|
@ -133,7 +133,7 @@ Execute(The version number should be cached):
|
|||
AssertEqual
|
||||
\ {
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
|
||||
\ },
|
||||
|
|
|
@ -25,5 +25,5 @@ Execute(The isort callback should return the correct default values):
|
|||
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -' },
|
||||
\ ale#fixers#isort#Fix(bufnr(''))
|
||||
|
|
|
@ -21,7 +21,7 @@ Execute(project with phpcbf should use local by default):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
|
@ -43,7 +43,7 @@ Execute(The phpcbf callback should return the correct default values):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should include the phpcbf_standard option):
|
||||
|
@ -51,7 +51,7 @@ Execute(The phpcbf callback should include the phpcbf_standard option):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Before:
|
||||
|
@ -77,7 +77,7 @@ Execute(project with phpcbf should use local by default):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
|
||||
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
|
@ -99,7 +99,7 @@ Execute(The phpcbf callback should return the correct default values):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
Execute(The phpcbf callback should include the phpcbf_standard option):
|
||||
|
@ -107,6 +107,6 @@ Execute(The phpcbf callback should include the phpcbf_standard option):
|
|||
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
|
||||
\ ale#fixers#phpcbf#Fix(bufnr(''))
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ Execute(--eslint-config-path should be set for 4.2.0 and up):
|
|||
\ 'command':
|
||||
\ ale#Escape('prettier-eslint')
|
||||
\ . ' %t'
|
||||
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --write'
|
||||
\ },
|
||||
\ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.2.0'])
|
||||
|
@ -87,7 +87,7 @@ Execute(The new --stdin-filepath option should be used when the version is new e
|
|||
\ {
|
||||
\ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
|
||||
\ . ale#Escape('prettier-eslint')
|
||||
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
|
||||
\ . ' --stdin-filepath %s --stdin',
|
||||
\ },
|
||||
\ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.4.0'])
|
||||
|
|
|
@ -34,7 +34,7 @@ Execute(The rubocop callback should include configuration files):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
|
||||
\ . ' --config ' . ale#Escape(ale#path#Winify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
|
||||
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
|
||||
\ . ' --auto-correct %t',
|
||||
\ },
|
||||
\ ale#fixers#rubocop#Fix(bufnr(''))
|
||||
|
@ -47,7 +47,7 @@ Execute(The rubocop callback should include custom rubocop options):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
|
||||
\ . ' --config ' . ale#Escape(ale#path#Winify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
|
||||
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
|
||||
\ . ' --except Lint/Debugger'
|
||||
\ . ' --auto-correct %t',
|
||||
\ },
|
||||
|
|
|
@ -11,7 +11,7 @@ Execute(The executable path should be correct):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#standard#Fix(bufnr(''))
|
||||
|
|
|
@ -11,7 +11,7 @@ Execute(The executable path should be correct):
|
|||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#stylelint#Fix(bufnr(''))
|
||||
|
|
|
@ -26,7 +26,7 @@ Execute(The yapf callback should return the correct default values):
|
|||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))},
|
||||
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))},
|
||||
\ ale#fixers#yapf#Fix(bufnr(''))
|
||||
\
|
||||
Execute(The yapf should include the .style.yapf file if present):
|
||||
|
@ -35,8 +35,8 @@ Execute(The yapf should include the .style.yapf file if present):
|
|||
AssertEqual
|
||||
\ {
|
||||
\ 'command':
|
||||
\ ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))
|
||||
\ . ' --no-local-style'
|
||||
\ . ' --style ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/dir_with_yapf_config/.style.yapf')),
|
||||
\ . ' --style ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/dir_with_yapf_config/.style.yapf')),
|
||||
\ },
|
||||
\ ale#fixers#yapf#Fix(bufnr(''))
|
||||
|
|
|
@ -34,7 +34,7 @@ Execute(The brakeman handler should parse JSON correctly):
|
|||
\ '"fingerprint": "1234",',
|
||||
\ '"check_name": "SQL",',
|
||||
\ '"message": "Possible SQL injection",',
|
||||
\ '"file": "' . substitute(ale#path#Winify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
|
||||
\ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
|
||||
\ '"line": 84,',
|
||||
\ '"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",',
|
||||
\ '"code": "Thing.connection.execute(params[:data])",',
|
||||
|
@ -53,7 +53,7 @@ Execute(The brakeman handler should parse JSON correctly):
|
|||
\ '"fingerprint": "1235",',
|
||||
\ '"check_name": "ModelAttrAccessible",',
|
||||
\ '"message": "Potentially dangerous attribute available for mass assignment",',
|
||||
\ '"file": "' . substitute(ale#path#Winify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
|
||||
\ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
|
||||
\ '"line": null,',
|
||||
\ '"link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",',
|
||||
\ '"code": ":name",',
|
||||
|
|
|
@ -48,11 +48,11 @@ Execute(The ghc handler should handle ghc 8 output):
|
|||
\ ],
|
||||
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
|
||||
\ '',
|
||||
\ ale#path#Winify('src/Appoint/Lib.hs') . ':6:1: error:',
|
||||
\ ale#path#Simplify('src/Appoint/Lib.hs') . ':6:1: error:',
|
||||
\ ' Failed to load interface for ‘GitHub.Data’',
|
||||
\ ' Use -v to see a list of the files searched for.',
|
||||
\ '',
|
||||
\ ale#path#Winify('src/Appoint/Lib.hs') . ':7:1: warning:',
|
||||
\ ale#path#Simplify('src/Appoint/Lib.hs') . ':7:1: warning:',
|
||||
\ ' Failed to load interface for ‘GitHub.Endpoints.PullRequests’',
|
||||
\ ' Use -v to see a list of the files searched for.',
|
||||
\ ])
|
||||
|
@ -92,12 +92,12 @@ Execute(The ghc handler should handle ghc 7 output):
|
|||
\ },
|
||||
\ ],
|
||||
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
|
||||
\ ale#path#Winify('src/Main.hs') . ':168:1:',
|
||||
\ ale#path#Simplify('src/Main.hs') . ':168:1:',
|
||||
\ ' parse error (possibly incorrect indentation or mismatched brackets)',
|
||||
\ ale#path#Winify('src/Main.hs') . ':84:1:Warning:',
|
||||
\ ale#path#Simplify('src/Main.hs') . ':84:1:Warning:',
|
||||
\ ' Top-level binding with no type signature:',
|
||||
\ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
|
||||
\ ale#path#Winify('src/Main.hs') . ':94:5:Error:',
|
||||
\ ale#path#Simplify('src/Main.hs') . ':94:5:Error:',
|
||||
\ ' Some other error',
|
||||
\ ])
|
||||
|
||||
|
@ -122,7 +122,7 @@ Execute(The ghc handler should handle stack 1.5.1 output):
|
|||
\ },
|
||||
\ ],
|
||||
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
|
||||
\ ' ' . ale#path#Winify('src/Main.hs') . ':160:14: error:',
|
||||
\ ' ' . ale#path#Simplify('src/Main.hs') . ':160:14: error:',
|
||||
\ ' • Expecting one fewer arguments to ‘Exp’',
|
||||
\ ' Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’',
|
||||
\ ' • In the type ‘Exp a’',
|
||||
|
|
|
@ -37,7 +37,7 @@ Execute (The gobuild handler should handle relative paths correctly):
|
|||
\ 'col': 0,
|
||||
\ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#go#gobuild#Handler(bufnr(''), [
|
||||
|
|
|
@ -41,14 +41,14 @@ Execute (The gometalinter handler should handle paths correctly):
|
|||
\ 'col': 3,
|
||||
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
|
||||
\ 'type': 'W',
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 37,
|
||||
\ 'col': 5,
|
||||
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#go#gometalinter#Handler(bufnr(''), [
|
||||
|
|
|
@ -69,13 +69,13 @@ Execute(The javac handler should resolve files from different directories):
|
|||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'filename': ale#path#Winify(g:dir . '/Foo.java'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/Foo.java'),
|
||||
\ 'lnum': 1,
|
||||
\ 'text': 'error: some error',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'filename': ale#path#Winify(g:dir . '/Bar.java'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/Bar.java'),
|
||||
\ 'lnum': 1,
|
||||
\ 'text': 'error: some error',
|
||||
\ 'type': 'E',
|
||||
|
|
|
@ -32,14 +32,14 @@ Execute(The lessc handler should handle errors for other files in the same direc
|
|||
\ 'col': 1,
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Unrecognised input. Possibly missing something',
|
||||
\ 'filename': ale#path#Winify(g:dir . '/imported.less')
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/imported.less')
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 1,
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Unrecognised input. Possibly missing something',
|
||||
\ 'filename': ale#path#Winify(g:dir . '/imported.less')
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/imported.less')
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#less#lessc#Handle(bufnr(''), [
|
||||
|
@ -59,7 +59,7 @@ Execute(The lessc handler should handle errors for files in directories above co
|
|||
\ 'col': 1,
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Unrecognised input. Possibly missing something',
|
||||
\ 'filename': ale#path#Winify(g:dir . '/../imported2.less')
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/../imported2.less')
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#less#lessc#Handle(bufnr(''), [
|
||||
|
|
|
@ -18,7 +18,7 @@ Execute(The mcs handler should work with the default of the buffer's directory):
|
|||
\ 'text': '; expected',
|
||||
\ 'code': 'CS1001',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/Test.cs', 'add_drive'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/Test.cs'),
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#cs#mcsc#Handle(347, [
|
||||
|
@ -37,7 +37,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
|
|||
\ 'text': '; expected',
|
||||
\ 'code': 'CS1001',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'),
|
||||
\ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 101,
|
||||
|
@ -45,7 +45,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
|
|||
\ 'text': 'Unexpected processor directive (no #if for this #endif)',
|
||||
\ 'code': 'CS1028',
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'),
|
||||
\ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 10,
|
||||
|
@ -53,7 +53,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
|
|||
\ 'text': 'some warning',
|
||||
\ 'code': 'CS0123',
|
||||
\ 'type': 'W',
|
||||
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'),
|
||||
\ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#cs#mcsc#Handle(347, [
|
||||
|
|
|
@ -15,35 +15,35 @@ Execute(The mypy handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'lnum': 768,
|
||||
\ 'col': 38,
|
||||
\ 'filename': ale#path#Winify(g:dir . '/baz.py'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 821,
|
||||
\ 'col': 38,
|
||||
\ 'filename': ale#path#Winify(g:dir . '/baz.py'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 38,
|
||||
\ 'col': 44,
|
||||
\ 'filename': ale#path#Winify(g:dir . '/other.py'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/other.py'),
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 15,
|
||||
\ 'col': 3,
|
||||
\ 'filename': ale#path#Winify(g:dir . '/__init__.py'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Argument 1 to "somefunc" has incompatible type "int"; expected "str"'
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 72,
|
||||
\ 'col': 1,
|
||||
\ 'filename': ale#path#Winify(g:dir . '/__init__.py'),
|
||||
\ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
|
||||
\ 'type': 'W',
|
||||
\ 'text': 'Some warning',
|
||||
\ },
|
||||
|
|
|
@ -15,9 +15,9 @@ Execute(The Perl linter should ignore errors from other files):
|
|||
\ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'},
|
||||
\ ],
|
||||
\ ale_linters#perl#perl#Handle(bufnr(''), [
|
||||
\ 'syntax error at ' . ale#path#Winify(g:dir . '/foo.pm') . ' line 4, near "aklsdfjmy "',
|
||||
\ 'Compilation failed in require at ' . ale#path#Winify(g:dir . '/bar.pl') . ' line 2.',
|
||||
\ 'BEGIN failed--compilation aborted at ' . ale#path#Winify(g:dir . '/bar.pl') . ' line 2.',
|
||||
\ 'syntax error at ' . ale#path#Simplify(g:dir . '/foo.pm') . ' line 4, near "aklsdfjmy "',
|
||||
\ 'Compilation failed in require at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
|
||||
\ 'BEGIN failed--compilation aborted at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
|
||||
\ ])
|
||||
|
||||
Execute(The Perl linter should complain about failing to locate modules):
|
||||
|
|
|
@ -8,21 +8,21 @@ Execute(Warning and error messages should be handled correctly):
|
|||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_python.rst'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_python.rst'),
|
||||
\ 'lnum': 7,
|
||||
\ 'col': 0,
|
||||
\ 'type': 'W',
|
||||
\ 'text': '(python) unexpected EOF while parsing',
|
||||
\ },
|
||||
\ {
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_cpp.rst'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_cpp.rst'),
|
||||
\ 'lnum': 9,
|
||||
\ 'col': 0,
|
||||
\ 'type': 'W',
|
||||
\ 'text': '(cpp) error: ''x'' was not declared in this scope',
|
||||
\ },
|
||||
\ {
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_rst.rst'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_rst.rst'),
|
||||
\ 'lnum': 1,
|
||||
\ 'col': 0,
|
||||
\ 'type': 'E',
|
||||
|
|
|
@ -110,7 +110,7 @@ Execute(The Rust handler should handle cargo output):
|
|||
\ 'byte_start': 11505,
|
||||
\ 'column_end': 8,
|
||||
\ 'column_start': 5,
|
||||
\ 'file_name': ale#path#Winify('src/playpen.rs'),
|
||||
\ 'file_name': ale#path#Simplify('src/playpen.rs'),
|
||||
\ 'is_primary': v:true,
|
||||
\ 'label': v:null,
|
||||
\ 'line_end': 15,
|
||||
|
@ -130,7 +130,7 @@ Execute(The Rust handler should handle cargo output):
|
|||
\ 'byte_start': 11494,
|
||||
\ 'column_end': 10,
|
||||
\ 'column_start': 7,
|
||||
\ 'file_name': ale#path#Winify('src/playpen.rs'),
|
||||
\ 'file_name': ale#path#Simplify('src/playpen.rs'),
|
||||
\ 'is_primary': v:true,
|
||||
\ 'label': v:null,
|
||||
\ 'line_end': 13,
|
||||
|
@ -174,7 +174,7 @@ Execute(The Rust handler should should errors from expansion spans):
|
|||
\ 'byte_start': 1,
|
||||
\ 'column_end': 1,
|
||||
\ 'column_start': 1,
|
||||
\ 'file_name': ale#path#Winify('src/other.rs'),
|
||||
\ 'file_name': ale#path#Simplify('src/other.rs'),
|
||||
\ 'is_primary': v:true,
|
||||
\ 'label': 'some other error',
|
||||
\ 'line_end': 4,
|
||||
|
@ -185,7 +185,7 @@ Execute(The Rust handler should should errors from expansion spans):
|
|||
\ 'byte_start': 52,
|
||||
\ 'column_end': 23,
|
||||
\ 'column_start': 21,
|
||||
\ 'file_name': ale#path#Winify('src/playpen.rs'),
|
||||
\ 'file_name': ale#path#Simplify('src/playpen.rs'),
|
||||
\ 'is_primary': v:true,
|
||||
\ 'label': 'expected bool, found integral variable',
|
||||
\ 'line_end': 4,
|
||||
|
@ -227,7 +227,7 @@ Execute(The Rust handler should show detailed errors):
|
|||
\ 'column_end': 23,
|
||||
\ 'column_start': 21,
|
||||
\ 'expansion': v:null,
|
||||
\ 'file_name': ale#path#Winify('src/playpen.rs'),
|
||||
\ 'file_name': ale#path#Simplify('src/playpen.rs'),
|
||||
\ 'is_primary': v:true,
|
||||
\ 'label': 'expected bool, found integral variable',
|
||||
\ 'line_end': 4,
|
||||
|
|
|
@ -27,7 +27,7 @@ Execute(The tslint handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'lnum': 1,
|
||||
\ 'col': 15,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'end_lnum': 1,
|
||||
\ 'type': 'E',
|
||||
\ 'end_col': 15,
|
||||
|
@ -37,7 +37,7 @@ Execute(The tslint handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 8,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'end_lnum': 3,
|
||||
\ 'type': 'W',
|
||||
\ 'end_col': 12,
|
||||
|
@ -46,7 +46,7 @@ Execute(The tslint handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 8,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/something-else.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/something-else.ts'),
|
||||
\ 'end_lnum': 3,
|
||||
\ 'type': 'W',
|
||||
\ 'end_col': 12,
|
||||
|
@ -56,7 +56,7 @@ Execute(The tslint handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'lnum': 31,
|
||||
\ 'col': 9,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'end_lnum': 31,
|
||||
\ 'type': 'E',
|
||||
\ 'end_col': 20,
|
||||
|
@ -157,7 +157,7 @@ Execute(The tslint handler report errors for empty files by default):
|
|||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 1,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'end_lnum': 2,
|
||||
\ 'type': 'E',
|
||||
\ 'end_col': 1,
|
||||
|
@ -231,7 +231,7 @@ Execute(The tslint handler should report errors when the ignore option is on, bu
|
|||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 1,
|
||||
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
|
||||
\ 'end_lnum': 2,
|
||||
\ 'type': 'E',
|
||||
\ 'end_col': 1,
|
||||
|
|
|
@ -150,7 +150,7 @@ Execute(ale#lsp#tsserver_message#Open() should return correct messages):
|
|||
\ 1,
|
||||
\ 'ts@open',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ }
|
||||
\ ],
|
||||
\ ale#lsp#tsserver_message#Open(bufnr(''))
|
||||
|
@ -161,7 +161,7 @@ Execute(ale#lsp#tsserver_message#Close() should return correct messages):
|
|||
\ 1,
|
||||
\ 'ts@close',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ }
|
||||
\ ],
|
||||
\ ale#lsp#tsserver_message#Close(bufnr(''))
|
||||
|
@ -172,7 +172,7 @@ Execute(ale#lsp#tsserver_message#Change() should return correct messages):
|
|||
\ 1,
|
||||
\ 'ts@change',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ 'line': 1,
|
||||
\ 'offset': 1,
|
||||
\ 'endLine': 1073741824,
|
||||
|
@ -188,7 +188,7 @@ Execute(ale#lsp#tsserver_message#Geterr() should return correct messages):
|
|||
\ 1,
|
||||
\ 'ts@geterr',
|
||||
\ {
|
||||
\ 'files': [ale#path#Winify(g:dir . '/foo/bar.ts')],
|
||||
\ 'files': [ale#path#Simplify(g:dir . '/foo/bar.ts')],
|
||||
\ }
|
||||
\ ],
|
||||
\ ale#lsp#tsserver_message#Geterr(bufnr(''))
|
||||
|
@ -199,7 +199,7 @@ Execute(ale#lsp#tsserver_message#Completions() should return correct messages):
|
|||
\ 0,
|
||||
\ 'ts@completions',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ 'line': 347,
|
||||
\ 'offset': 12,
|
||||
\ 'prefix': 'abc',
|
||||
|
@ -213,7 +213,7 @@ Execute(ale#lsp#tsserver_message#CompletionEntryDetails() should return correct
|
|||
\ 0,
|
||||
\ 'ts@completionEntryDetails',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ 'line': 347,
|
||||
\ 'offset': 12,
|
||||
\ 'entryNames': ['foo', 'bar'],
|
||||
|
@ -227,7 +227,7 @@ Execute(ale#lsp#tsserver_message#Definition() should return correct messages):
|
|||
\ 0,
|
||||
\ 'ts@definition',
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
|
||||
\ 'line': 347,
|
||||
\ 'offset': 12,
|
||||
\ }
|
||||
|
|
|
@ -39,8 +39,8 @@ Execute(The C GCC handler should include 'include' directories for projects with
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -52,8 +52,8 @@ Execute(The C GCC handler should include 'include' directories for projects with
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -65,8 +65,8 @@ Execute(The C GCC handler should include root directories for projects with .h f
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -78,8 +78,8 @@ Execute(The C GCC handler should include root directories for projects with .hpp
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -91,8 +91,8 @@ Execute(The C Clang handler should include 'include' directories for projects wi
|
|||
AssertEqual
|
||||
\ ale#Escape('clang')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -104,8 +104,8 @@ Execute(The C Clang handler should include 'include' directories for projects wi
|
|||
AssertEqual
|
||||
\ ale#Escape('clang')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -117,8 +117,8 @@ Execute(The C Clang handler should include root directories for projects with .h
|
|||
AssertEqual
|
||||
\ ale#Escape('clang')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -130,8 +130,8 @@ Execute(The C Clang handler should include root directories for projects with .h
|
|||
AssertEqual
|
||||
\ ale#Escape('clang')
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#c#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -143,8 +143,8 @@ Execute(The C++ GCC handler should include 'include' directories for projects wi
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -156,8 +156,8 @@ Execute(The C++ GCC handler should include 'include' directories for projects wi
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -169,8 +169,8 @@ Execute(The C++ GCC handler should include root directories for projects with .h
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -182,8 +182,8 @@ Execute(The C++ GCC handler should include root directories for projects with .h
|
|||
AssertEqual
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -195,8 +195,8 @@ Execute(The C++ Clang handler should include 'include' directories for projects
|
|||
AssertEqual
|
||||
\ ale#Escape('clang++')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -208,8 +208,8 @@ Execute(The C++ Clang handler should include 'include' directories for projects
|
|||
AssertEqual
|
||||
\ ale#Escape('clang++')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -221,8 +221,8 @@ Execute(The C++ Clang handler should include root directories for projects with
|
|||
AssertEqual
|
||||
\ ale#Escape('clang++')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -234,8 +234,8 @@ Execute(The C++ Clang handler should include root directories for projects with
|
|||
AssertEqual
|
||||
\ ale#Escape('clang++')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -255,8 +255,8 @@ Execute(The C++ Clang handler shoud use the include directory based on the .git
|
|||
AssertEqual
|
||||
\ ale#Escape('clang++')
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/git_and_nested_makefiles/src')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/git_and_nested_makefiles/include')) . ' '
|
||||
\ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/git_and_nested_makefiles/src')) . ' '
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/git_and_nested_makefiles/include')) . ' '
|
||||
\ . ' -'
|
||||
\ , ale_linters#cpp#clang#GetCommand(bufnr(''))
|
||||
|
||||
|
@ -268,7 +268,7 @@ Execute(The C++ ClangTidy handler should include json folders for projects with
|
|||
AssertEqual
|
||||
\ ale#Escape('clang-tidy')
|
||||
\ . ' -checks=' . ale#Escape('*') . ' %s '
|
||||
\ . '-p ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/json_project/build'))
|
||||
\ . '-p ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/json_project/build'))
|
||||
\ , ale_linters#cpp#clangtidy#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Move .git/HEAD back):
|
||||
|
|
|
@ -13,7 +13,7 @@ Execute(--config should be set when the .csslintrc file is found):
|
|||
AssertEqual
|
||||
\ (
|
||||
\ 'csslint --format=compact '
|
||||
\ . '--config=' . ale#Escape(ale#path#Winify(g:dir . '/csslint-test-files/some-app/.csslintrc'))
|
||||
\ . '--config=' . ale#Escape(ale#path#Simplify(g:dir . '/csslint-test-files/some-app/.csslintrc'))
|
||||
\ . ' %t'
|
||||
\ ),
|
||||
\ ale_linters#css#csslint#GetCommand(bufnr(''))
|
||||
|
|
|
@ -12,7 +12,7 @@ Execute(should get valid executable with default params):
|
|||
call ale#test#SetFilename('elm-test-files/app/testfile.elm')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/elm-test-files/app/node_modules/.bin/elm-make'),
|
||||
\ ale#path#Simplify(g:dir . '/elm-test-files/app/node_modules/.bin/elm-make'),
|
||||
\ ale_linters#elm#make#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(should get valid executable with 'use_global' params):
|
||||
|
|
|
@ -17,7 +17,7 @@ Execute(create-react-app directories should be detected correctly):
|
|||
call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'),
|
||||
\ ale#path#Simplify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'),
|
||||
\ ale#handlers#eslint#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override create-react-app detection):
|
||||
|
@ -33,7 +33,7 @@ Execute(other app directories should be detected correctly):
|
|||
call ale#test#SetFilename('eslint-test-files/other-app/subdir/testfile.js')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/eslint-test-files/node_modules/.bin/eslint'),
|
||||
\ ale#path#Simplify(g:dir . '/eslint-test-files/node_modules/.bin/eslint'),
|
||||
\ ale#handlers#eslint#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override other app directories):
|
||||
|
@ -49,7 +49,7 @@ Execute(eslint_d should be detected correctly):
|
|||
call ale#test#SetFilename('eslint-test-files/app-with-eslint-d/testfile.js')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'),
|
||||
\ ale#path#Simplify(g:dir . '/eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'),
|
||||
\ ale#handlers#eslint#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(eslint.js executables should be run with node on Windows):
|
||||
|
@ -59,6 +59,6 @@ Execute(eslint.js executables should be run with node on Windows):
|
|||
" We have to execute the file with node.
|
||||
AssertEqual
|
||||
\ ale#Escape('node.exe') . ' '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
|
||||
\ . ' -f unix --stdin --stdin-filename %s',
|
||||
\ ale#handlers#eslint#GetCommand(bufnr(''))
|
||||
|
|
|
@ -8,7 +8,7 @@ Execute(We should be able to find a directory some directory down):
|
|||
call ale#test#SetFilename('top/middle/bottom/dummy.txt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/'),
|
||||
\ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/'),
|
||||
\ ale#path#FindNearestDirectory(bufnr('%'), 'ale-special-directory-name-dont-use-this-please')
|
||||
|
||||
Execute(We shouldn't find anything for files which don't match):
|
||||
|
|
|
@ -70,7 +70,7 @@ Execute(Other files should be jumped to for definition responses):
|
|||
\ 'success': v:true,
|
||||
\ 'body': [
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/completion_dummy_file'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/completion_dummy_file'),
|
||||
\ 'start': {'line': 3, 'offset': 7},
|
||||
\ },
|
||||
\ ],
|
||||
|
@ -79,7 +79,7 @@ Execute(Other files should be jumped to for definition responses):
|
|||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
@ -95,7 +95,7 @@ Execute(Other files should be jumped to for definition responses in tabs too):
|
|||
\ 'success': v:true,
|
||||
\ 'body': [
|
||||
\ {
|
||||
\ 'file': ale#path#Winify(g:dir . '/completion_dummy_file'),
|
||||
\ 'file': ale#path#Simplify(g:dir . '/completion_dummy_file'),
|
||||
\ 'start': {'line': 3, 'offset': 7},
|
||||
\ },
|
||||
\ ],
|
||||
|
@ -104,7 +104,7 @@ Execute(Other files should be jumped to for definition responses in tabs too):
|
|||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'tabedit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
@ -150,7 +150,7 @@ Execute(Other files should be jumped to for LSP definition responses):
|
|||
\ {
|
||||
\ 'id': 3,
|
||||
\ 'result': {
|
||||
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'range': {
|
||||
\ 'start': {'line': 2, 'character': 7},
|
||||
\ },
|
||||
|
@ -160,7 +160,7 @@ Execute(Other files should be jumped to for LSP definition responses):
|
|||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
@ -173,7 +173,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
|
|||
\ {
|
||||
\ 'id': 3,
|
||||
\ 'result': {
|
||||
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'range': {
|
||||
\ 'start': {'line': 2, 'character': 7},
|
||||
\ },
|
||||
|
@ -183,7 +183,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
|
|||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'tabedit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
@ -197,13 +197,13 @@ Execute(Definition responses with lists should be handled):
|
|||
\ 'id': 3,
|
||||
\ 'result': [
|
||||
\ {
|
||||
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'range': {
|
||||
\ 'start': {'line': 2, 'character': 7},
|
||||
\ },
|
||||
\ },
|
||||
\ {
|
||||
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/other_file')),
|
||||
\ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/other_file')),
|
||||
\ 'range': {
|
||||
\ 'start': {'line': 20, 'character': 3},
|
||||
\ },
|
||||
|
@ -214,7 +214,7 @@ Execute(Definition responses with lists should be handled):
|
|||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
|
|
@ -10,7 +10,7 @@ Before:
|
|||
let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath())
|
||||
\ . ' -q printClasspath'
|
||||
|
||||
let g:gradle_init_path = ale#path#Winify(g:dir . '../../autoload/ale/gradle/init.gradle')
|
||||
let g:gradle_init_path = ale#path#Simplify(g:dir . '../../autoload/ale/gradle/init.gradle')
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
@ -25,18 +25,18 @@ Execute(Should return 'gradlew' command if project includes gradle wapper):
|
|||
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project'))
|
||||
\ . ' && ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew'))
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project'))
|
||||
\ . ' && ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project/gradlew'))
|
||||
\ . g:command_tail,
|
||||
\ ale#gradle#BuildClasspathCommand(bufnr(''))
|
||||
|
||||
Execute(Should return 'gradle' command if project does not include gradle wapper):
|
||||
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
|
||||
let $PATH .= (has('win32') ? ';' : ':')
|
||||
\ . ale#path#Winify(g:dir . '/gradle-test-files')
|
||||
\ . ale#path#Simplify(g:dir . '/gradle-test-files')
|
||||
|
||||
AssertEqual
|
||||
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/unwrapped-project'))
|
||||
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/unwrapped-project'))
|
||||
\ . ' && ' . ale#Escape('gradle')
|
||||
\ . g:command_tail,
|
||||
\ ale#gradle#BuildClasspathCommand(bufnr(''))
|
||||
|
|
|
@ -18,12 +18,12 @@ Execute(Should return 'gradlew' if found in parent directory):
|
|||
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew'),
|
||||
\ ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project/gradlew'),
|
||||
\ ale#gradle#FindExecutable(bufnr(''))
|
||||
|
||||
Execute(Should return 'gradle' if 'gradlew' not found in parent directory):
|
||||
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
|
||||
let $PATH .= (has('win32') ? ';': ':') . ale#path#Winify(g:dir . '/gradle-test-files')
|
||||
let $PATH .= (has('win32') ? ';': ':') . ale#path#Simplify(g:dir . '/gradle-test-files')
|
||||
|
||||
AssertEqual
|
||||
\ 'gradle',
|
||||
|
|
|
@ -10,21 +10,21 @@ Execute(Should return directory for 'gradlew' if found in parent directory):
|
|||
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project'),
|
||||
\ ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project'),
|
||||
\ ale#gradle#FindProjectRoot(bufnr(''))
|
||||
|
||||
Execute(Should return directory for 'settings.gradle' if found in parent directory):
|
||||
call ale#test#SetFilename('gradle-test-files/settings-gradle-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/gradle-test-files/settings-gradle-project'),
|
||||
\ ale#path#Simplify(g:dir . '/gradle-test-files/settings-gradle-project'),
|
||||
\ ale#gradle#FindProjectRoot(bufnr(''))
|
||||
|
||||
Execute(Should return directory for 'build.gradle' if found in parent directory):
|
||||
call ale#test#SetFilename('gradle-test-files/build-gradle-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/gradle-test-files/build-gradle-project'),
|
||||
\ ale#path#Simplify(g:dir . '/gradle-test-files/build-gradle-project'),
|
||||
\ ale#gradle#FindProjectRoot(bufnr(''))
|
||||
|
||||
Execute(Should return empty string if gradle files are not found in parent directory):
|
||||
|
|
|
@ -42,7 +42,7 @@ Execute(The loclist titles should be set appropriately):
|
|||
|
||||
if !has('nvim')
|
||||
AssertEqual
|
||||
\ {'title': ale#path#Winify(getcwd() . '/foo')},
|
||||
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
||||
\ getloclist(0, {'title': ''})
|
||||
endif
|
||||
|
||||
|
@ -72,6 +72,6 @@ Execute(The quickfix titles should be set appropriately):
|
|||
|
||||
if !has('nvim')
|
||||
AssertEqual
|
||||
\ {'title': ale#path#Winify(getcwd() . '/foo')},
|
||||
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
||||
\ getqflist({'title': ''})
|
||||
endif
|
||||
|
|
|
@ -8,7 +8,7 @@ Execute(We should be able to find a configuration file further up):
|
|||
call ale#test#SetFilename('top/middle/bottom/dummy.txt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/example.ini'),
|
||||
\ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/example.ini'),
|
||||
\ ale#path#FindNearestFile(bufnr('%'), 'example.ini')
|
||||
|
||||
Execute(We shouldn't find anything for files which don't match):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Before:
|
||||
function! CheckPath(path) abort
|
||||
return ale#path#IsBufferPath(bufnr(''), ale#path#Winify(a:path))
|
||||
return ale#path#IsBufferPath(bufnr(''), ale#path#Simplify(a:path))
|
||||
endfunction
|
||||
|
||||
After:
|
||||
|
|
|
@ -19,7 +19,7 @@ Execute(project with phpcs should use local by default):
|
|||
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs'),
|
||||
\ ale#path#Simplify(g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs'),
|
||||
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
|
|
|
@ -8,7 +8,7 @@ Execute(We should be able to find the local version of a file):
|
|||
call ale#test#SetFilename('top/middle/bottom/dummy.txt')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/example.ini'),
|
||||
\ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/example.ini'),
|
||||
\ ale#path#ResolveLocalPath(bufnr('%'), 'example.ini', '/global/config.ini')
|
||||
|
||||
Execute(We shouldn't find anything for files which don't match):
|
||||
|
|
|
@ -9,14 +9,14 @@ Execute(smlnj finds CM file if it exists):
|
|||
call ale#test#SetFilename('smlnj/cm/foo.sml')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/smlnj/cm/sources.cm'),
|
||||
\ ale#path#Simplify(g:dir . '/smlnj/cm/sources.cm'),
|
||||
\ ale#handlers#sml#GetCmFile(bufnr('%'))
|
||||
|
||||
Execute(smlnj finds CM file by searching upwards):
|
||||
call ale#test#SetFilename('smlnj/cm/path/to/bar.sml')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Winify(g:dir . '/smlnj/cm/sources.cm'),
|
||||
\ ale#path#Simplify(g:dir . '/smlnj/cm/sources.cm'),
|
||||
\ ale#handlers#sml#GetCmFile(bufnr('%'))
|
||||
|
||||
Execute(smlnj returns '' when no CM file found):
|
||||
|
|
|
@ -12,7 +12,7 @@ Execute(adjacent config file should be found):
|
|||
\ (
|
||||
\ ale#Escape('tflint')
|
||||
\ . ' --config '
|
||||
\ . ale#Escape(ale#path#Winify(g:dir . '/tflint-test-files/foo/.tflint.hcl'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/tflint-test-files/foo/.tflint.hcl'))
|
||||
\ . ' -f json %t'
|
||||
\ ),
|
||||
\ ale_linters#terraform#tflint#GetCommand(bufnr(''))
|
||||
|
|
Reference in a new issue