mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 13:14:29 +08:00
Fix the mscs tests on Windows, and use the improved Simplify for all tests instead.
This commit is contained in:
@@ -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(''))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user