mirror of https://github.com/dense-analysis/ale
#3633 - Put all dummy test files in test/test-files
This commit is contained in:
parent
3838ae118d
commit
b1d833417b
|
@ -188,6 +188,10 @@ Look at existing tests in the codebase for examples of how to write tests.
|
|||
Refer to the Vader documentation for general information on how to write Vader
|
||||
tests: https://github.com/junegunn/vader.vim
|
||||
|
||||
If you need to add any supporting files for tests, such as empty files present
|
||||
to test searching upwards through paths for configuration files, they can be
|
||||
added to the `test/test-files` directory.
|
||||
|
||||
See |ale-development-linter-tests| for more information on how to write linter
|
||||
tests.
|
||||
|
||||
|
|
|
@ -10,22 +10,22 @@ Execute(The global executable should be used when the local one cannot be found)
|
|||
\ ale#Escape('alex') . ' %s --text',
|
||||
|
||||
Execute(Should use the node_modules/.bin executable, if available):
|
||||
call ale#test#SetFilename('alex-node-modules/test_file.tex')
|
||||
call ale#test#SetFilename('../test-files/alex/node-modules/test_file.tex')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/alex-node-modules/node_modules/.bin/alex'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/alex-node-modules/node_modules/.bin/alex'))
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/alex/node-modules/node_modules/.bin/alex'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/alex/node-modules/node_modules/.bin/alex'))
|
||||
\ . ' %s --text',
|
||||
|
||||
Execute(Should use the node_modules/alex executable, if available):
|
||||
call ale#test#SetFilename('alex-node-modules-2/test_file.tex')
|
||||
call ale#test#SetFilename('../test-files/alex/node-modules-2/test_file.tex')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/alex-node-modules-2/node_modules/alex/cli.js'),
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/alex/node-modules-2/node_modules/alex/cli.js'),
|
||||
\ (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/alex-node-modules-2/node_modules/alex/cli.js'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/alex/node-modules-2/node_modules/alex/cli.js'))
|
||||
\ . ' %s --text',
|
||||
|
||||
Execute(Should let users configure a global executable and override local paths):
|
||||
call ale#test#SetFilename('write-good-node-modules-2/test_file.tex')
|
||||
call ale#test#SetFilename('../test-files/write-good/node-modules-2/test_file.tex')
|
||||
|
||||
let g:ale_alex_executable = '/path/to/custom/alex'
|
||||
let g:ale_alex_use_global = 1
|
||||
|
|
|
@ -13,15 +13,15 @@ Execute(The Angular LSP connection shouldn't be created outside of Angular proje
|
|||
AssertLinterNotExecuted
|
||||
|
||||
Execute(The default command for Angular should be correct):
|
||||
call ale#test#SetFilename('../test-projects/angular/test.html')
|
||||
call ale#test#SetFilename('../test-files/angular/test.html')
|
||||
let g:paths = {
|
||||
\ 'ngserver': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-server/bin/ngserver'),
|
||||
\ 'service': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-service'),
|
||||
\ 'typescript': ale#test#GetFilename('../test-projects/angular/node_modules/typescript'),
|
||||
\ 'ngserver': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-server/bin/ngserver'),
|
||||
\ 'service': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-service'),
|
||||
\ 'typescript': ale#test#GetFilename('../test-files/angular/node_modules/typescript'),
|
||||
\}
|
||||
|
||||
AssertLSPLanguage 'html'
|
||||
AssertLSPProject ale#test#GetFilename('../test-projects/angular')
|
||||
AssertLSPProject ale#test#GetFilename('../test-files/angular')
|
||||
AssertLinter g:paths.ngserver, ale#Escape(g:paths.ngserver)
|
||||
\ . ' --ngProbeLocations ' . ale#Escape(g:paths.service)
|
||||
\ . ' --tsProbeLocations ' . ale#Escape(g:paths.typescript)
|
||||
|
@ -30,14 +30,14 @@ Execute(The default command for Angular should be correct):
|
|||
Execute(It should be possible to use the global ngserver):
|
||||
let b:ale_html_angular_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('../test-projects/angular/test.html')
|
||||
call ale#test#SetFilename('../test-files/angular/test.html')
|
||||
let g:paths = {
|
||||
\ 'service': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-service'),
|
||||
\ 'typescript': ale#test#GetFilename('../test-projects/angular/node_modules/typescript'),
|
||||
\ 'service': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-service'),
|
||||
\ 'typescript': ale#test#GetFilename('../test-files/angular/node_modules/typescript'),
|
||||
\}
|
||||
|
||||
AssertLSPLanguage 'html'
|
||||
AssertLSPProject ale#test#GetFilename('../test-projects/angular')
|
||||
AssertLSPProject ale#test#GetFilename('../test-files/angular')
|
||||
AssertLinter 'ngserver', ale#Escape('ngserver')
|
||||
\ . ' --ngProbeLocations ' . ale#Escape(g:paths.service)
|
||||
\ . ' --tsProbeLocations ' . ale#Escape(g:paths.typescript)
|
||||
|
|
|
@ -42,24 +42,24 @@ Execute(The options should be configurable):
|
|||
\ ale#Escape('textlint') . ' --something -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from .bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_bin_path/foo.txt')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from textlint/bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_textlint_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_textlint_bin_path/foo.txt')
|
||||
|
||||
if has('win32')
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
else
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
endif
|
||||
|
|
|
@ -40,7 +40,7 @@ Execute(Setting executable to 'pipenv' appends 'run bandit'):
|
|||
|
||||
Execute(Pipenv is detected when python_bandit_auto_pipenv is set):
|
||||
let g:ale_python_bandit_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv')
|
||||
|
@ -49,10 +49,10 @@ Execute(Pipenv is detected when python_bandit_auto_pipenv is set):
|
|||
\ . ' -'
|
||||
|
||||
Execute(The bandit command callback should add .bandit by default):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_bandit/namespace/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_bandit/namespace/foo/bar.py')
|
||||
|
||||
let b:config_path = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_bandit/.bandit'
|
||||
\ g:dir . '/../test-files/python/with_bandit/.bandit'
|
||||
\)
|
||||
|
||||
AssertLinter 'bandit',
|
||||
|
@ -62,7 +62,7 @@ Execute(The bandit command callback should add .bandit by default):
|
|||
\ . ' -'
|
||||
|
||||
Execute(The bandit command callback should support not using .bandit):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_bandit/subdir/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_bandit/subdir/foo/bar.py')
|
||||
let g:ale_python_bandit_use_config = 0
|
||||
|
||||
AssertLinter 'bandit',
|
||||
|
|
|
@ -25,7 +25,7 @@ Execute(should configure bingo callback executable):
|
|||
AssertLinter 'boo', ale#Escape('boo')
|
||||
|
||||
Execute(should set bingo options):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
" let b:ale_completion_enabled = 1
|
||||
let b:ale_go_bingo_options = ''
|
||||
|
||||
|
@ -38,7 +38,7 @@ Execute(should set bingo options):
|
|||
\ ale#Escape('bingo') . ' --mode stdio --trace'
|
||||
|
||||
Execute(should support Go environment variables):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
let b:ale_go_go111module = 'on'
|
||||
|
||||
AssertLinter 'bingo',
|
||||
|
@ -46,9 +46,9 @@ Execute(should support Go environment variables):
|
|||
|
||||
|
||||
Execute(Should return directory for 'go.mod' if found in parent directory):
|
||||
call ale#test#SetFilename('../go_files/test.go')
|
||||
call ale#test#SetFilename('../test-files/go/test.go')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../go_files')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go')
|
||||
|
||||
Execute(Should return nearest directory with '.git' if found in parent directory):
|
||||
call ale#test#SetFilename('test.go')
|
||||
|
@ -57,7 +57,7 @@ Execute(Should return nearest directory with '.git' if found in parent directory
|
|||
AssertLSPProject g:dir
|
||||
|
||||
Execute(Should ignore 'go.mod' and return '.git' dir if modules off):
|
||||
call ale#test#SetFilename('../go_files/test.go')
|
||||
call ale#test#SetFilename('../test-files/go/test.go')
|
||||
|
||||
let b:ale_go_go111module = 'off'
|
||||
let b:parent_dir = ale#path#Simplify(g:dir . '/..')
|
||||
|
|
|
@ -5,28 +5,28 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The brakeman command callback should detect absence of a valid Rails app):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/test.rb')
|
||||
|
||||
AssertLinter 'brakeman', ''
|
||||
|
||||
Execute(The brakeman command callback should find a valid Rails app root):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
||||
|
||||
AssertLinter 'brakeman', ale#Escape('brakeman')
|
||||
\ . ' -f json -q -p '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|
||||
|
||||
Execute(The brakeman command callback should include configured options):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
||||
|
||||
let g:ale_ruby_brakeman_options = '--combobulate'
|
||||
|
||||
AssertLinter 'brakeman', ale#Escape('brakeman')
|
||||
\ . ' -f json -q --combobulate -p '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|
||||
|
||||
Execute(Setting bundle appends 'exec brakeman'):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
||||
|
||||
let g:ale_ruby_brakeman_executable = 'bundle'
|
||||
let g:ale_ruby_brakeman_options = '--combobulate'
|
||||
|
@ -34,4 +34,4 @@ Execute(Setting bundle appends 'exec brakeman'):
|
|||
AssertLinter 'bundle', ale#Escape('bundle')
|
||||
\ . ' exec brakeman'
|
||||
\ . ' -f json -q --combobulate -p '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|
||||
|
|
|
@ -16,27 +16,27 @@ Execute(The project root should be detected correctly using compile_commands.jso
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.c')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls-root file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.c')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls-root/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls-root')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'ccls', ale#Escape('ccls')
|
||||
|
@ -53,17 +53,17 @@ Execute(The initialization options should be configurable):
|
|||
AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' }
|
||||
|
||||
Execute(The compile command database should be detected correctly):
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.c')
|
||||
|
||||
AssertLSPOptions {}
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.c')
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json') }
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_build_dir/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_build_dir/dummy.c')
|
||||
let b:ale_c_build_dir_names = ['unusual_build_dir_name']
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_build_dir/unusual_build_dir_name') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_build_dir/unusual_build_dir_name') }
|
||||
|
|
|
@ -23,9 +23,9 @@ Execute(The project root should be detected correctly):
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('clangd_paths/with_compile_commands/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/clangd/with_compile_commands/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/clangd_paths/with_compile_commands')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/clangd/with_compile_commands')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
let g:ale_c_clangd_executable = 'foobar'
|
||||
|
@ -38,7 +38,7 @@ Execute(The options should be configurable):
|
|||
AssertLinter 'clangd', ale#Escape('clangd') . ' ' . b:ale_c_clangd_options
|
||||
|
||||
Execute(The compile command database should be detected correctly):
|
||||
call ale#test#SetFilename('clangd_paths/with_build_dir/dummy_src/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/clangd/with_build_dir/dummy_src/dummy.c')
|
||||
|
||||
let b:ale_c_clangd_options = ''
|
||||
let b:ale_c_build_dir = ''
|
||||
|
@ -47,5 +47,5 @@ Execute(The compile command database should be detected correctly):
|
|||
|
||||
AssertLinter 'clangd', ale#Escape('clangd')
|
||||
\ . ' -compile-commands-dir='
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/clangd_paths/with_build_dir/unusual_build_dir_name'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/clangd/with_build_dir/unusual_build_dir_name'))
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ Execute(The executable should be configurable):
|
|||
AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail
|
||||
|
||||
Execute(cppcheck for C should detect compile_commands.json files):
|
||||
call ale#test#SetFilename('cppcheck_paths/one/foo.c')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/one/foo.c')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/one')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
@ -31,9 +31,9 @@ Execute(cppcheck for C should detect compile_commands.json files):
|
|||
\ . ' --enable=style %t'
|
||||
|
||||
Execute(cppcheck for C should detect compile_commands.json files in build directories):
|
||||
call ale#test#SetFilename('cppcheck_paths/with_build_dir/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/with_build_dir/foo.cpp')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/with_build_dir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/with_build_dir')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
@ -41,26 +41,26 @@ Execute(cppcheck for C should detect compile_commands.json files in build direct
|
|||
\ . ' --enable=style %t'
|
||||
|
||||
Execute(cppcheck for C should include file dir if compile_commands.json file is not found):
|
||||
call ale#test#SetFilename('cppcheck_paths/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/foo.cpp')
|
||||
|
||||
AssertLinter 'cppcheck',
|
||||
\ ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
\ . ' --enable=style'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck'))
|
||||
\ . ' %t'
|
||||
|
||||
Execute(cppcheck for C should ignore compile_commands.json file if buffer is modified):
|
||||
call ale#test#SetFilename('cppcheck_paths/one/foo.c')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/one/foo.c')
|
||||
|
||||
set buftype=
|
||||
set modified
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/one')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
\ . ' --enable=style'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))
|
||||
\ . ' %t'
|
||||
|
|
|
@ -9,18 +9,18 @@ Execute(The project root should be detected correctly using compile_commands.jso
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('cquery_paths/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/cquery/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/cquery_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/cquery')
|
||||
|
||||
Execute(The project root should be detected correctly using .cquery file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.c')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('cquery_paths/with_cquery/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/cquery/with_cquery/dummy.c')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/cquery_paths/with_cquery')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/cquery/with_cquery')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'cquery', ale#Escape('cquery')
|
||||
|
|
|
@ -37,126 +37,126 @@ After:
|
|||
|
||||
Execute(The C cc linter should include 'include' directories for projects with a Makefile):
|
||||
call ale#assert#SetUpLinterTest('c', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/makefile_project/subdir/file.c')
|
||||
call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.c')
|
||||
let g:ale_c_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/makefile_project/include'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C cc linter should include 'include' directories for projects with a configure file):
|
||||
call ale#assert#SetUpLinterTest('c', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/configure_project/subdir/file.c')
|
||||
call ale#test#SetFilename('../test-files/c/configure_project/subdir/file.c')
|
||||
let g:ale_c_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/configure_project/include'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/configure_project/include'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C cc linter should include root directories for projects with .h files in them):
|
||||
call ale#assert#SetUpLinterTest('c', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/h_file_project/subdir/file.c')
|
||||
call ale#test#SetFilename('../test-files/c/h_file_project/subdir/file.c')
|
||||
let g:ale_c_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/h_file_project'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/h_file_project'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C cc linter should include root directories for projects with .hpp files in them):
|
||||
call ale#assert#SetUpLinterTest('c', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/hpp_file_project/subdir/file.c')
|
||||
call ale#test#SetFilename('../test-files/c/hpp_file_project/subdir/file.c')
|
||||
let g:ale_c_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/hpp_file_project'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/hpp_file_project'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C ClangTidy handler should include 'include' directories for projects with a Makefile):
|
||||
call ale#assert#SetUpLinterTest('c', 'clangtidy')
|
||||
call ale#test#SetFilename('../test_c_projects/makefile_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
|
||||
let g:ale_c_clangtidy_options = ''
|
||||
|
||||
AssertLinter 'clang-tidy',
|
||||
\ ale#Escape('clang-tidy')
|
||||
\ . ' %s '
|
||||
\ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/makefile_project/include'))
|
||||
\ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
|
||||
|
||||
Execute(The C++ cc linter should include 'include' directories for projects with a Makefile):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/makefile_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
|
||||
let g:ale_cpp_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/makefile_project/include'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C++ cc linter should include 'include' directories for projects with a configure file):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/configure_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/configure_project/subdir/file.cpp')
|
||||
let g:ale_cpp_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/configure_project/include'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/configure_project/include'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C++ cc linter should include root directories for projects with .h files in them):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/h_file_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/h_file_project/subdir/file.cpp')
|
||||
let g:ale_cpp_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/h_file_project'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/h_file_project'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C++ cc linter should include root directories for projects with .hpp files in them):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'cc')
|
||||
call ale#test#SetFilename('../test_c_projects/hpp_file_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/hpp_file_project/subdir/file.cpp')
|
||||
let g:ale_cpp_cc_options = ''
|
||||
|
||||
AssertLinter 'gcc',
|
||||
\ ale#Escape('gcc')
|
||||
\ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/hpp_file_project'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/hpp_file_project'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The C++ ClangTidy handler should include json folders for projects with suitable build directory in them):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'clangtidy')
|
||||
call ale#test#SetFilename('../test_c_projects/json_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/json_project/subdir/file.cpp')
|
||||
|
||||
AssertLinter 'clang-tidy',
|
||||
\ ale#Escape('clang-tidy')
|
||||
\ . ' %s '
|
||||
\ . '-p ' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/json_project/build'))
|
||||
\ . '-p ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/json_project/build'))
|
||||
|
||||
Execute(The C++ ClangTidy handler should include 'include' directories for projects with a Makefile):
|
||||
call ale#assert#SetUpLinterTest('cpp', 'clangtidy')
|
||||
call ale#test#SetFilename('../test_c_projects/makefile_project/subdir/file.cpp')
|
||||
call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
|
||||
let g:ale_cpp_clangtidy_options = ''
|
||||
|
||||
AssertLinter 'clang-tidy',
|
||||
\ ale#Escape('clang-tidy')
|
||||
\ . ' %s '
|
||||
\ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test_c_projects/makefile_project/include'))
|
||||
\ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('rust', 'cargo')
|
||||
call ale#test#SetFilename('cargo_paths/test.rs')
|
||||
call ale#test#SetFilename('../test-files/cargo/test.rs')
|
||||
|
||||
let g:cd = 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cargo_paths')) . ' && '
|
||||
let g:cd = 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cargo')) . ' && '
|
||||
let g:suffix = ' --frozen --message-format=json -q'
|
||||
let g:ale_rust_cargo_avoid_whole_workspace = 0
|
||||
|
||||
|
@ -120,9 +120,9 @@ Execute(--all-features should be used when g:ale_rust_cargo_default_feature_beha
|
|||
|
||||
Execute(Cargo should run from the crate directory when set to avoid the workspace):
|
||||
let g:ale_rust_cargo_avoid_whole_workspace = 1
|
||||
call ale#test#SetFilename('cargo_workspace_paths/subpath/test.rs')
|
||||
call ale#test#SetFilename('../test-files/cargo/workspace_paths/subpath/test.rs')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cargo_workspace_paths/subpath')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cargo/workspace_paths/subpath')
|
||||
call ale#semver#ResetVersionCache()
|
||||
AssertLinter 'cargo', [
|
||||
\ ale#Escape('cargo') . ' --version',
|
||||
|
@ -131,7 +131,7 @@ Execute(Cargo should run from the crate directory when set to avoid the workspac
|
|||
|
||||
Execute(Cargo should not run from the crate directory when not set to avoid the workspace):
|
||||
let g:ale_rust_cargo_avoid_whole_workspace = 0
|
||||
call ale#test#SetFilename('cargo_workspace_paths/subpath/test.rs')
|
||||
call ale#test#SetFilename('../test-files/cargo/workspace_paths/subpath/test.rs')
|
||||
|
||||
AssertLinterCwd ''
|
||||
call ale#semver#ResetVersionCache()
|
||||
|
|
|
@ -29,11 +29,11 @@ Execute(Custom options should be supported):
|
|||
\ . ' %s'
|
||||
|
||||
Execute(configuration files set in _config should be supported):
|
||||
let b:ale_java_checkstyle_config = ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml')
|
||||
let b:ale_java_checkstyle_config = ale#path#Simplify(g:dir . '/../test-files/checkstyle/other_config.xml')
|
||||
|
||||
AssertLinter 'checkstyle',
|
||||
\ ale#Escape('checkstyle')
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/checkstyle/other_config.xml'))
|
||||
\ . ' %s'
|
||||
|
||||
Execute(configuration files set in _options should be preferred over _config):
|
||||
|
@ -47,7 +47,7 @@ Execute(configuration files set in _options should be preferred over _config):
|
|||
AssertLinter 'checkstyle', ale#Escape('checkstyle') . ' -x -c /bar.xml %s'
|
||||
|
||||
Execute(google_checks.xml should be used by default):
|
||||
call ale#test#SetFilename('checkstyle_paths/test.java')
|
||||
call ale#test#SetFilename('../test-files/checkstyle/test.java')
|
||||
|
||||
AssertLinter 'checkstyle',
|
||||
\ ale#Escape('checkstyle')
|
||||
|
@ -55,18 +55,18 @@ Execute(google_checks.xml should be used by default):
|
|||
\ . ' %s'
|
||||
|
||||
Execute(Other relative paths should be supported):
|
||||
let b:ale_java_checkstyle_config = 'checkstyle_paths/other_config.xml'
|
||||
let b:ale_java_checkstyle_config = '../test-files/checkstyle/other_config.xml'
|
||||
|
||||
AssertLinter 'checkstyle',
|
||||
\ ale#Escape('checkstyle')
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/checkstyle/other_config.xml'))
|
||||
\ . ' %s'
|
||||
|
||||
call ale#test#SetFilename('checkstyle_paths/test.java')
|
||||
call ale#test#SetFilename('../test-files/checkstyle/test.java')
|
||||
|
||||
let b:ale_java_checkstyle_config = 'other_config.xml'
|
||||
|
||||
AssertLinter 'checkstyle',
|
||||
\ ale#Escape('checkstyle')
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/checkstyle_paths/other_config.xml'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/checkstyle/other_config.xml'))
|
||||
\ . ' %s'
|
||||
|
|
|
@ -16,27 +16,27 @@ Execute(The project root should be detected correctly using compile_commands.jso
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.cpp')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.cpp')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.cpp')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.cpp')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.cpp')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls-root file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.cpp')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.cpp')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls-root/dummy.cpp')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls-root')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'ccls', ale#Escape('ccls')
|
||||
|
@ -53,17 +53,17 @@ Execute(The initialization options should be configurable):
|
|||
AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' }
|
||||
|
||||
Execute(The compile command database should be detected correctly):
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.c')
|
||||
|
||||
AssertLSPOptions {}
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.c')
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json') }
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_build_dir/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_build_dir/dummy.c')
|
||||
let b:ale_c_build_dir_names = ['unusual_build_dir_name']
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_build_dir/unusual_build_dir_name') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_build_dir/unusual_build_dir_name') }
|
||||
|
|
|
@ -21,9 +21,9 @@ Execute(The executable should be configurable):
|
|||
AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail
|
||||
|
||||
Execute(cppcheck for C++ should detect compile_commands.json files):
|
||||
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/one/foo.cpp')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/one')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c++'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
@ -31,9 +31,9 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
|
|||
\ . ' --enable=style %t'
|
||||
|
||||
Execute(cppcheck for C++ should detect compile_commands.json files in build directories):
|
||||
call ale#test#SetFilename('cppcheck_paths/with_build_dir/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/with_build_dir/foo.cpp')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/with_build_dir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/with_build_dir')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c++'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
@ -41,26 +41,26 @@ Execute(cppcheck for C++ should detect compile_commands.json files in build dire
|
|||
\ . ' --enable=style %t'
|
||||
|
||||
Execute(cppcheck for C++ should include file dir if compile_commands.json file is not found):
|
||||
call ale#test#SetFilename('cppcheck_paths/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/foo.cpp')
|
||||
|
||||
AssertLinter 'cppcheck',
|
||||
\ ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c++'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
\ . ' --enable=style'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck'))
|
||||
\ . ' %t'
|
||||
|
||||
Execute(cppcheck for C++ should ignore compile_commands.json file if buffer is modified):
|
||||
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
||||
call ale#test#SetFilename('../test-files/cppcheck/one/foo.cpp')
|
||||
|
||||
set buftype=
|
||||
set modified
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/cppcheck_paths/one')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
|
||||
AssertLinter 'cppcheck', ale#Escape('cppcheck')
|
||||
\ . ' -q --language=c++'
|
||||
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
\ . ' --enable=style'
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one'))
|
||||
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))
|
||||
\ . ' %t'
|
||||
|
|
|
@ -12,18 +12,18 @@ Execute(The project root should be detected correctly using compile_commands.jso
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('cquery_paths/dummy.cpp')
|
||||
call ale#test#SetFilename('../test-files/cquery/dummy.cpp')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/cquery_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/cquery')
|
||||
|
||||
Execute(The project root should be detected correctly using .cquery file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.cpp')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('cquery_paths/with_cquery/dummy.cpp')
|
||||
call ale#test#SetFilename('../test-files/cquery/with_cquery/dummy.cpp')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/cquery_paths/with_cquery')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/cquery/with_cquery')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'cquery', ale#Escape('cquery')
|
||||
|
|
|
@ -5,11 +5,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Should require the nearest features dir, if one is found):
|
||||
call ale#test#SetFilename('../cucumber_fixtures/features/cuke.feature')
|
||||
call ale#test#SetFilename('../test-files/cucumber/features/cuke.feature')
|
||||
|
||||
AssertLinter 'cucumber',
|
||||
\ 'cucumber --dry-run --quiet --strict --format=json '
|
||||
\ . '-r ' . ale#Escape(ale#path#Simplify(g:dir . '/../cucumber_fixtures/features/')) . ' %t'
|
||||
\ . '-r ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cucumber/features/')) . ' %t'
|
||||
|
||||
Execute(Should require nothing if no features dir is found):
|
||||
call ale#test#SetFilename('something/without/a/features/dir')
|
||||
|
|
|
@ -13,8 +13,8 @@ Execute(The executable should be configurable):
|
|||
AssertLinter 'foobar', ale#Escape('foobar') . ' %s'
|
||||
|
||||
Execute(The .packages file should be set if detected):
|
||||
call ale#test#SetFilename('dart_paths/foo')
|
||||
call ale#test#SetFilename('../test-files/dart/foo')
|
||||
|
||||
AssertLinter 'dartanalyzer', ale#Escape('dartanalyzer')
|
||||
\ . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/dart_paths/.packages'))
|
||||
\ . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/dart/.packages'))
|
||||
\ . ' %s'
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('elixir', 'dialyxir')
|
||||
call ale#test#SetFilename('elixir_paths/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/mix_project/lib/app.ex')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Builds dialyxir command with a normal project):
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/mix_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/mix_project')
|
||||
AssertLinter 'mix', 'mix help dialyzer && mix dialyzer'
|
||||
|
||||
Execute(Builds dialyxir command with an umbrella project):
|
||||
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
AssertLinter 'mix', 'mix help dialyzer && mix dialyzer'
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('elixir', 'dogma')
|
||||
call ale#test#SetFilename('elixir_paths/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/mix_project/lib/app.ex')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Builds dogma command with a normal project):
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/mix_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/mix_project')
|
||||
AssertLinter 'mix', 'mix help dogma && mix dogma %s --format=flycheck'
|
||||
|
||||
Execute(Builds dogma command with an umbrella project):
|
||||
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
AssertLinter 'mix', 'mix help dogma && mix dogma %s --format=flycheck'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('elixir', 'credo')
|
||||
call ale#test#SetFilename('elixir_paths/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/mix_project/lib/app.ex')
|
||||
|
||||
|
||||
After:
|
||||
|
@ -9,14 +9,14 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Builds credo command with normal project):
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/mix_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/mix_project')
|
||||
AssertLinter 'mix',
|
||||
\ 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s'
|
||||
|
||||
Execute(Builds credo command with umbrella project):
|
||||
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
AssertLinter 'mix',
|
||||
\ 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s'
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ Execute(should configure elixir-ls release location):
|
|||
endif
|
||||
|
||||
Execute(should set correct LSP values):
|
||||
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/app1/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/app1/lib/app.ex')
|
||||
|
||||
AssertLSPLanguage 'elixir'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
|
||||
Execute(should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('elixir', 'mix')
|
||||
call ale#test#SetFilename('elixir_paths/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/mix_project/lib/app.ex')
|
||||
let g:env_prefix = ale#Env('MIX_BUILD_PATH', 'TEMP_DIR')
|
||||
|
||||
After:
|
||||
|
@ -9,11 +9,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default mix command should be correct):
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/mix_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/mix_project')
|
||||
AssertLinter 'mix', g:env_prefix . 'mix compile %s'
|
||||
|
||||
Execute(Build mix commands with an umbrella root):
|
||||
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/mix_project/lib/app.ex')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
AssertLinter 'mix', g:env_prefix . 'mix compile %s'
|
||||
|
|
|
@ -5,19 +5,19 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default executable path should be correct):
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
AssertLinter 'elm-language-server', ale#Escape('elm-language-server') . ' --stdio'
|
||||
|
||||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../elm-test-files/newapp')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/elm/newapp')
|
||||
|
||||
Execute(Should let users configure a global executable and override local paths):
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
let g:ale_elm_ls_executable = '/path/to/custom/elm-language-server'
|
||||
let g:ale_elm_ls_use_global = 1
|
||||
|
|
|
@ -7,48 +7,48 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(should get valid executable with default params):
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../elm-test-files/newapp/node_modules/.bin/elm')
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../test-files/elm/newapp/node_modules/.bin/elm')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/newapp')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/newapp')
|
||||
AssertLinter g:executable,
|
||||
\ ale#Escape(g:executable) . ' make --report=json --output=/dev/null %t'
|
||||
|
||||
Execute(should get elm-test executable for test code with elm >= 0.19):
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/tests/TestSuite.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/tests/TestSuite.elm')
|
||||
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../elm-test-files/newapp/node_modules/.bin/elm-test')
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../test-files/elm/newapp/node_modules/.bin/elm-test')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/newapp')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/newapp')
|
||||
AssertLinter g:executable,
|
||||
\ ale#Escape(g:executable) . ' make --report=json --output=/dev/null --compiler '
|
||||
\ . ale#path#Simplify(g:dir . '/../elm-test-files/newapp/node_modules/.bin/elm') . ' %t'
|
||||
\ . ale#path#Simplify(g:dir . '/../test-files/elm/newapp/node_modules/.bin/elm') . ' %t'
|
||||
|
||||
Execute(should fallback to elm executable with elm >= 0.19):
|
||||
call ale#test#SetFilename('../elm-test-files/newapp-notests/tests/TestMain.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp-notests/tests/TestMain.elm')
|
||||
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../elm-test-files/newapp-notests/node_modules/.bin/elm')
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../test-files/elm/newapp-notests/node_modules/.bin/elm')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/newapp-notests')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/newapp-notests')
|
||||
AssertLinter g:executable,
|
||||
\ ale#Escape(g:executable) . ' make --report=json --output=/dev/null %t'
|
||||
|
||||
Execute(should get plain elm executable for test code with elm < 0.19):
|
||||
call ale#test#SetFilename('../elm-test-files/oldapp/tests/TestSuite.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/oldapp/tests/TestSuite.elm')
|
||||
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../elm-test-files/oldapp/node_modules/.bin/elm')
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../test-files/elm/oldapp/node_modules/.bin/elm')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/oldapp')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/oldapp')
|
||||
AssertLinter g:executable,
|
||||
\ ale#Escape(g:executable) . ' make --report=json --output=/dev/null %t'
|
||||
|
||||
Execute(should get valid executable with 'use_global' params):
|
||||
let g:ale_elm_make_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/newapp')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/newapp')
|
||||
AssertLinter 'elm',
|
||||
\ ale#Escape('elm') . ' make --report=json --output=/dev/null %t'
|
||||
|
||||
|
@ -56,8 +56,8 @@ Execute(should get valid executable with 'use_global' and 'executable' params):
|
|||
let g:ale_elm_make_executable = 'other-elm'
|
||||
let g:ale_elm_make_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('../elm-test-files/newapp/src/Main.elm')
|
||||
call ale#test#SetFilename('../test-files/elm/newapp/src/Main.elm')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../elm-test-files/newapp')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/elm/newapp')
|
||||
AssertLinter 'other-elm',
|
||||
\ ale#Escape('other-elm') . ' make --report=json --output=/dev/null %t'
|
||||
|
|
|
@ -5,12 +5,12 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Executable should not contain any filter code by default):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/file.rb')
|
||||
|
||||
AssertLinter 'erb', 'erb -P -T - -x %t | ruby -c'
|
||||
|
||||
Execute(Executable should filter invalid eRuby when inside a Rails project):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
|
||||
AssertLinter 'erb',
|
||||
\ 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
|
||||
|
|
|
@ -5,7 +5,7 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Executable should not contain any filter code by default):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/file.rb')
|
||||
|
||||
AssertLinter 'ruby', [
|
||||
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
|
||||
|
@ -13,7 +13,7 @@ Execute(Executable should not contain any filter code by default):
|
|||
\]
|
||||
|
||||
Execute(Executable should filter invalid eRuby when inside a Rails project):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
|
||||
AssertLinter 'ruby', [
|
||||
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
|
||||
|
|
|
@ -5,12 +5,12 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Executable should not contain any filter code by default):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/file.rb')
|
||||
|
||||
AssertLinter 'erubis', 'erubis -x %t | ruby -c'
|
||||
|
||||
Execute(Executable should filter invalid eRuby when inside a Rails project):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
|
||||
AssertLinter 'erubis',
|
||||
\ 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . '< %t | ruby -c'
|
||||
|
|
|
@ -15,62 +15,62 @@ Execute(The default command should be correct):
|
|||
AssertLinter 'eslint', ale#Escape('eslint') . b:args
|
||||
|
||||
Execute(create-react-app directories should be detected correctly):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files/react-app')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
|
||||
AssertLinter b:executable,
|
||||
\ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
|
||||
\ . ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(use-global should override create-react-app detection):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
|
||||
|
||||
let g:ale_javascript_eslint_use_global = 1
|
||||
let g:ale_javascript_eslint_executable = 'eslint_d'
|
||||
|
||||
let b:executable = 'eslint_d'
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files/react-app')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(other app directories should be detected correctly):
|
||||
call ale#test#SetFilename('../eslint-test-files/other-app/subdir/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/other-app/subdir/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/node_modules/.bin/eslint')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(use-global should override other app directories):
|
||||
call ale#test#SetFilename('../eslint-test-files/other-app/subdir/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/other-app/subdir/testfile.js')
|
||||
|
||||
let g:ale_javascript_eslint_use_global = 1
|
||||
let g:ale_javascript_eslint_executable = 'eslint_d'
|
||||
|
||||
let b:executable = 'eslint_d'
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(eslint_d should be detected correctly):
|
||||
call ale#test#SetFilename('../eslint-test-files/app-with-eslint-d/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/app-with-eslint-d/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(eslint.js executables should be run with node on Windows):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files/react-app')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
|
||||
AssertLinter b:executable,
|
||||
\ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
|
||||
\ . ale#Escape(b:executable) . b:args
|
||||
|
||||
Execute(eslint.js should be run from a containing project with eslint):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir-with-package-json/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-package-json/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../eslint-test-files/react-app')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
|
||||
AssertLinter b:executable,
|
||||
\ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
|
||||
\ . ale#Escape(b:executable) . b:args
|
||||
|
|
|
@ -56,7 +56,7 @@ Execute(The option for disabling changing directories should work):
|
|||
\]
|
||||
|
||||
Execute(The option for changing directory to project root should work):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#python#FindProjectRootIni(bufnr(''))
|
||||
call ale#semver#ResetVersionCache()
|
||||
|
@ -67,7 +67,7 @@ Execute(The option for changing directory to project root should work):
|
|||
|
||||
Execute(The option for changing directory to file dir should work):
|
||||
let g:ale_python_flake8_change_directory = 'file'
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
|
||||
|
||||
AssertLinter 'flake8', [
|
||||
\ ale#Escape('flake8') . ' --version',
|
||||
|
@ -110,10 +110,10 @@ 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')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/flake8'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/flake8'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, [
|
||||
|
@ -124,43 +124,43 @@ Execute(The flake8 callbacks should detect virtualenv directories):
|
|||
\]
|
||||
|
||||
Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_manifest/namespace/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_manifest'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/python/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')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_setup/namespace/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_setup'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/python/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')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_pytest/namespace/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_pytest'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/python/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')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/namespace_package_tox'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/python/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')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir'),
|
||||
\ ale#python#FindProjectRoot(bufnr(''))
|
||||
|
||||
" Some users currently run flake8 this way, so we should support it.
|
||||
Execute(Using `python -m flake8` should be supported for running flake8):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let g:ale_python_flake8_executable = 'python'
|
||||
let g:ale_python_flake8_options = '-m flake8 --some-option'
|
||||
|
@ -194,7 +194,7 @@ Execute(Setting executable to 'pipenv' should append 'run flake8'):
|
|||
|
||||
Execute(Pipenv is detected when python_flake8_auto_pipenv is set):
|
||||
let g:ale_python_flake8_auto_pipenv = 1
|
||||
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinterCwd ale#python#FindProjectRootIni(bufnr(''))
|
||||
AssertLinter 'pipenv',
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
Before:
|
||||
runtime ale_linters/javascript/flow.vim
|
||||
|
||||
call ale#assert#SetUpLinterTest('javascript', 'flow')
|
||||
call ale#test#SetDirectory('/testplugin/test/')
|
||||
|
||||
After:
|
||||
unlet! b:ale_javascript_flow_use_respect_pragma
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(flow should return a command to run if a .flowconfig file exists):
|
||||
call ale#test#SetFilename('flow/a/sub/dummy')
|
||||
call ale#test#SetFilename('../test-files/flow/a/sub/dummy')
|
||||
|
||||
AssertLinter 'flow',
|
||||
\ ale#Escape('flow')
|
||||
|
@ -17,7 +13,7 @@ Execute(flow should return a command to run if a .flowconfig file exists):
|
|||
\ . (!has('win32') ? '; echo' : '')
|
||||
|
||||
Execute(flow should not use the respect pragma argument if the option is off):
|
||||
call ale#test#SetFilename('flow/a/sub/dummy')
|
||||
call ale#test#SetFilename('../test-files/flow/a/sub/dummy')
|
||||
|
||||
let b:ale_javascript_flow_use_respect_pragma = 0
|
||||
|
||||
|
@ -27,7 +23,7 @@ Execute(flow should not use the respect pragma argument if the option is off):
|
|||
\ . (!has('win32') ? '; echo' : '')
|
||||
|
||||
Execute(flow should should not use --respect-pragma for old versions):
|
||||
call ale#test#SetFilename('flow/a/sub/dummy')
|
||||
call ale#test#SetFilename('../test-files/flow/a/sub/dummy')
|
||||
|
||||
GivenCommandOutput [
|
||||
\ 'Warning: `flow --version` is deprecated in favor of `flow version`',
|
||||
|
@ -41,6 +37,6 @@ Execute(flow should should not use --respect-pragma for old versions):
|
|||
\]
|
||||
|
||||
Execute(flow should not return a command to run if no .flowconfig file exists):
|
||||
call ale#test#SetFilename('flow/b/sub/dummy')
|
||||
call ale#test#SetFilename('../test-files/flow/b/sub/dummy')
|
||||
|
||||
AssertLinterNotExecuted
|
|
@ -10,9 +10,9 @@ Execute(The default executable path should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('fortran-fortls-project/test.F90')
|
||||
call ale#test#SetFilename('../test-files/fortls-project/test.F90')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/fortran-fortls-project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/fortls-project')
|
||||
|
||||
Execute(The language should be correct):
|
||||
AssertLSPLanguage 'fortran'
|
||||
|
|
|
@ -24,20 +24,20 @@ Execute(The gitlint command callback should let you set options):
|
|||
AssertLinter 'gitlint', ale#Escape('gitlint') . ' --some-option lint'
|
||||
|
||||
Execute(The gitlint callbacks shouldn't detect virtualenv directories where they don't exist):
|
||||
call ale#test#SetFilename('python_paths/no_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
|
||||
AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
|
||||
|
||||
Execute(The gitlint callbacks should detect virtualenv directories):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/gitlint'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/gitlint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' lint'
|
||||
|
||||
Execute(You should able able to use the global gitlint instead):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
let g:ale_gitcommit_gitlint_use_global = 1
|
||||
|
||||
AssertLinter 'gitlint', ale#Escape('gitlint') . ' lint'
|
||||
|
|
|
@ -5,7 +5,7 @@ Before:
|
|||
let b:ale_go_go111module = ''
|
||||
|
||||
call ale#assert#SetUpLinterTest('go', 'gofmt')
|
||||
call ale#test#SetFilename('../go_files/testfile2.go')
|
||||
call ale#test#SetFilename('../test-files/go/testfile2.go')
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
|
|
@ -7,9 +7,9 @@ Before:
|
|||
let g:sep = has('win32') ? ';' : ':'
|
||||
|
||||
call ale#assert#SetUpLinterTest('go', 'langserver')
|
||||
let $GOPATH = ale#path#Simplify(g:dir . '/go_paths/go1')
|
||||
let $GOPATH = ale#path#Simplify(g:dir . '/../test-files/go/go1')
|
||||
\ . g:sep
|
||||
\ . ale#path#Simplify(g:dir . '/go_paths/go2')
|
||||
\ . ale#path#Simplify(g:dir . '/../test-files/go/go2')
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
@ -29,7 +29,7 @@ Execute(should configure go-langserver callback executable):
|
|||
AssertLinter 'boo', ale#Escape('boo')
|
||||
|
||||
Execute(should set go-langserver options):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
let b:ale_completion_enabled = 1
|
||||
let b:ale_go_langserver_options = ''
|
||||
|
||||
|
@ -42,7 +42,7 @@ Execute(should set go-langserver options):
|
|||
\ ale#Escape('go-langserver') . ' -gocodecompletion -trace'
|
||||
|
||||
Execute(should ignore go-langserver -gocodecompletion option):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
|
||||
let b:ale_go_langserver_options = '-trace -gocodecompletion'
|
||||
let b:ale_completion_enabled = 1
|
||||
|
@ -61,16 +61,16 @@ Execute(should support Go environment variables):
|
|||
\ ale#Env('GO111MODULE', 'on') . ale#Escape('go-langserver')
|
||||
|
||||
Execute(should set go-langserver for go app1):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
|
||||
AssertLSPLanguage 'go'
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go1')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go/go1')
|
||||
|
||||
Execute(should set go-langserver for go app2):
|
||||
call ale#test#SetFilename('go_paths/go2/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go2/prj1/file.go')
|
||||
|
||||
AssertLSPLanguage 'go'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go2')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go/go2')
|
||||
|
|
|
@ -24,7 +24,7 @@ Execute(should configure gopls callback executable):
|
|||
AssertLinter 'boo', ale#Escape('boo')
|
||||
|
||||
Execute(should set gopls options):
|
||||
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
||||
call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
|
||||
" let b:ale_completion_enabled = 1
|
||||
let b:ale_go_gopls_options = ''
|
||||
|
||||
|
@ -46,9 +46,9 @@ Execute(should support go environment variables):
|
|||
\ ale#Env('GO111MODULE', 'off') . ale#Escape('gopls') . ' --mode stdio'
|
||||
|
||||
Execute(Should return directory for 'go.mod' if found in parent directory):
|
||||
call ale#test#SetFilename('../go_files/test.go')
|
||||
call ale#test#SetFilename('../test-files/go/test.go')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../go_files')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go')
|
||||
|
||||
Execute(Should return nearest directory with '.git' if found in parent directory):
|
||||
call ale#test#SetFilename('test.go')
|
||||
|
@ -60,7 +60,7 @@ Execute(Should return nearest directory with '.git' if found in parent directory
|
|||
AssertLSPProject g:dir
|
||||
|
||||
Execute(Should ignore 'go.mod' and return '.git' dir if modules off):
|
||||
call ale#test#SetFilename('../go_files/test.go')
|
||||
call ale#test#SetFilename('../test-files/go/test.go')
|
||||
|
||||
let b:ale_go_go111module = 'off'
|
||||
let b:parent_dir = ale#path#Simplify(g:dir . '/..')
|
||||
|
|
|
@ -2,7 +2,7 @@ Before:
|
|||
Save g:ale_go_go111module
|
||||
|
||||
call ale#assert#SetUpLinterTest('go', 'gosimple')
|
||||
call ale#test#SetFilename('../go_files/testfile2.go')
|
||||
call ale#test#SetFilename('../test-files/go/testfile2.go')
|
||||
|
||||
After:
|
||||
unlet! b:ale_go_go111module
|
||||
|
|
|
@ -2,7 +2,7 @@ Before:
|
|||
Save g:ale_go_go111module
|
||||
|
||||
call ale#assert#SetUpLinterTest('go', 'gotype')
|
||||
call ale#test#SetFilename('../go_files/testfile2.go')
|
||||
call ale#test#SetFilename('../test-files/go/testfile2.go')
|
||||
|
||||
After:
|
||||
unlet! b:ale_go_go111module
|
||||
|
|
|
@ -14,23 +14,23 @@ Execute(The default command should be correct):
|
|||
AssertLinter 'haml-lint', 'haml-lint %t'
|
||||
|
||||
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#Simplify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml')
|
||||
call ale#test#SetFilename('../test-files/hamllint/rubocop-yml/subdir/file.haml')
|
||||
let b:conf = ale#path#Simplify(g:dir . '/../test-files/hamllint/rubocop-yml/.rubocop.yml')
|
||||
|
||||
AssertLinter 'haml-lint',
|
||||
\ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf) . 'haml-lint %t'
|
||||
|
||||
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#Simplify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml')
|
||||
call ale#test#SetFilename('../test-files/hamllint/haml-lint-yml/subdir/file.haml')
|
||||
let b:conf = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-yml/.haml-lint.yml')
|
||||
|
||||
AssertLinter 'haml-lint',
|
||||
\ 'haml-lint --config ' . ale#Escape(b:conf) . ' %t',
|
||||
|
||||
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#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')
|
||||
call ale#test#SetFilename('../test-files/hamllint/haml-lint-and-rubocop/subdir/file.haml')
|
||||
let b:conf_hamllint = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-and-rubocop/.haml-lint.yml')
|
||||
let b:conf_rubocop = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-and-rubocop/.rubocop.yml')
|
||||
|
||||
AssertLinter 'haml-lint',
|
||||
\ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf_rubocop)
|
||||
|
|
|
@ -8,6 +8,6 @@ Execute(The linter should not be executed when there's no stack.yaml file):
|
|||
AssertLinterNotExecuted
|
||||
|
||||
Execute(The linter should be executed when there is a stack.yaml file):
|
||||
call ale#test#SetFilename('stack_build_paths/test.hs')
|
||||
call ale#test#SetFilename('../test-files/stack/test.hs')
|
||||
|
||||
AssertLinter 'stack', 'stack build --fast'
|
||||
|
|
|
@ -8,7 +8,7 @@ Execute(The linter should not be executed when there's no stack.yaml file):
|
|||
AssertLinterNotExecuted
|
||||
|
||||
Execute(The linter should be executed when there is a stack.yaml file):
|
||||
call ale#test#SetFilename('stack_ghc_paths/test.hs')
|
||||
call ale#test#SetFilename('../test-files/stack/test.hs')
|
||||
|
||||
AssertLinterCwd '%s:h'
|
||||
AssertLinter 'stack', 'stack ghc -- -fno-code -v0 %t'
|
||||
|
|
|
@ -28,11 +28,11 @@ After:
|
|||
call ale#linter#Reset()
|
||||
|
||||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.html')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/stylelint_paths/node_modules/.bin/stylelint'
|
||||
\ . '/../test-files/stylelint/node_modules/.bin/stylelint'
|
||||
\)
|
||||
|
||||
AssertEqual b:executable, ale_linters#html#stylelint#GetExecutable(bufnr(''))
|
||||
|
@ -44,7 +44,7 @@ Execute(The global override should work):
|
|||
let b:ale_html_stylelint_executable = 'foobar'
|
||||
let b:ale_html_stylelint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.html')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
|
||||
|
||||
AssertEqual 'foobar', ale_linters#html#stylelint#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('html', 'htmlhint')
|
||||
call ale#test#SetFilename('htmlhint_paths/test.html')
|
||||
call ale#test#SetFilename('../test-files/htmlhint/test.html')
|
||||
|
||||
let g:node_executable = ale#path#Simplify(
|
||||
\ g:dir . '/htmlhint_paths/node_modules/.bin/htmlhint'
|
||||
\ g:dir . '/../test-files/htmlhint/node_modules/.bin/htmlhint'
|
||||
\)
|
||||
let g:config_path = ale#path#Simplify(
|
||||
\ g:dir . '/htmlhint_paths/with_config/.htmlhintrc'
|
||||
\ g:dir . '/../test-files/htmlhint/with_config/.htmlhintrc'
|
||||
\)
|
||||
|
||||
After:
|
||||
|
@ -33,7 +33,7 @@ Execute(--format=unix should be removed from the options if added):
|
|||
\ ale#Escape(g:node_executable) . ' --format=unix %t'
|
||||
|
||||
Execute(The configuration file should be automatically detected):
|
||||
call ale#test#SetFilename('htmlhint_paths/with_config/test.html')
|
||||
call ale#test#SetFilename('../test-files/htmlhint/with_config/test.html')
|
||||
|
||||
AssertLinter g:node_executable,
|
||||
\ ale#Escape(g:node_executable)
|
||||
|
@ -42,7 +42,7 @@ Execute(The configuration file should be automatically detected):
|
|||
|
||||
" This is so old configurations which might include the config will work.
|
||||
Execute(The configuration file should be configurable through the options variable):
|
||||
call ale#test#SetFilename('htmlhint_paths/with_config/test.html')
|
||||
call ale#test#SetFilename('../test-files/htmlhint/with_config/test.html')
|
||||
let g:ale_html_htmlhint_options = '--config=/foo/bar/.htmlhintrc'
|
||||
|
||||
AssertLinter g:node_executable,
|
||||
|
|
|
@ -9,12 +9,12 @@ Execute(should set correct defaults):
|
|||
AssertLinter 'ink-language-server', ale#Escape('ink-language-server') . ' --stdio'
|
||||
|
||||
Execute(should set correct LSP values):
|
||||
call ale#test#SetFilename('ink_paths/story/main.ink')
|
||||
call ale#test#SetFilename('../test-files/ink/story/main.ink')
|
||||
|
||||
AssertLSPLanguage 'ink'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ink_paths/story')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ink/story')
|
||||
|
||||
Execute(should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('inko', 'inko')
|
||||
call ale#test#SetFilename('inko_paths/test.inko')
|
||||
call ale#test#SetFilename('../test-files/inko/test.inko')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
@ -10,11 +10,11 @@ Execute(The default executable path should be correct):
|
|||
|
||||
Execute(The inko callback should include tests/ for test paths):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
noautocmd e! inko_paths/tests/test/test_foo.inko
|
||||
noautocmd e! ../test-files/inko/tests/test/test_foo.inko
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
AssertLinter 'inko',
|
||||
\ ale#Escape('inko')
|
||||
\ . ' build --check --format=json --include '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/inko_paths/tests/'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/inko/tests/'))
|
||||
\ . ' %s'
|
||||
|
|
|
@ -161,27 +161,27 @@ Execute(The javac callback should combine discovered classpaths and manual ones)
|
|||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
||||
Execute(The javac callback should use string type g:ale_java_javac_sourcepath correctly):
|
||||
let g:ale_java_javac_sourcepath = 'java_paths/build/gen/main'
|
||||
let g:ale_java_javac_sourcepath = '../test-files/java/with_main/build/gen/main'
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ g:prefix
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/')
|
||||
\ )
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
||||
Execute(The javac callback should use list type g:ale_java_javac_sourcepath correctly):
|
||||
let g:ale_java_javac_sourcepath = ['java_paths/build/gen/main']
|
||||
let g:ale_java_javac_sourcepath = ['../test-files/java/with_main/build/gen/main']
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ g:prefix
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/')
|
||||
\ )
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
||||
Execute(The javac callback shouldn't add -sourcepath when g:ale_java_javac_sourcepath variable path doesn't exist):
|
||||
let g:ale_java_javac_sourcepath = 'java_paths/build/gen3/main'
|
||||
let g:ale_java_javac_sourcepath = '../test-files/java/with_main/build/gen3/main'
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ g:prefix
|
||||
|
@ -189,78 +189,78 @@ Execute(The javac callback shouldn't add -sourcepath when g:ale_java_javac_sourc
|
|||
|
||||
Execute(The javac callback should combine discovered sourcepath and manual ones):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
call ale#test#SetFilename('java_paths/src/main/java/com/something/dummy.java')
|
||||
call ale#test#SetFilename('../test-files/java/with_main/src/main/java/com/something/dummy.java')
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
let g:ale_java_javac_sourcepath = 'java_paths/build/gen/main'
|
||||
let g:ale_java_javac_sourcepath = '../test-files/java/with_main/build/gen/main'
|
||||
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {})
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
|
||||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
||||
let g:ale_java_javac_sourcepath = 'java_paths/build/gen/main'
|
||||
\ . g:cp_sep . 'java_paths/build/gen2/main'
|
||||
let g:ale_java_javac_sourcepath = '../test-files/java/with_main/build/gen/main'
|
||||
\ . g:cp_sep . '../test-files/java/with_main/build/gen2/main'
|
||||
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {})
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen2/main/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen2/main/')
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
|
||||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
||||
let g:ale_java_javac_sourcepath = ['java_paths/build/gen/main']
|
||||
let g:ale_java_javac_sourcepath = ['../test-files/java/with_main/build/gen/main']
|
||||
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {})
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/')
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
|
||||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
||||
let g:ale_java_javac_sourcepath = [
|
||||
\ 'java_paths/build/gen/main',
|
||||
\ 'java_paths/build/gen2/main'
|
||||
\ '../test-files/java/with_main/build/gen/main',
|
||||
\ '../test-files/java/with_main/build/gen2/main'
|
||||
\ ]
|
||||
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {})
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/build/gen2/main/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen/main/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/build/gen2/main/')
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
|
||||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
||||
Execute(The javac callback should detect source directories):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
noautocmd e! java_paths/src/main/java/com/something/dummy
|
||||
noautocmd e! ../test-files/java/with_main/src/main/java/com/something/dummy
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/')
|
||||
\ )
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
||||
Execute(The javac callback should combine detected source directories and classpaths):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
call ale#test#SetFilename('java_paths/src/main/java/com/something/dummy.java')
|
||||
call ale#test#SetFilename('../test-files/java/with_main/src/main/java/com/something/dummy.java')
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [
|
||||
|
@ -274,7 +274,7 @@ Execute(The javac callback should combine detected source directories and classp
|
|||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
|
||||
\ . ' -sourcepath ' . ale#Escape(
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/')
|
||||
\ )
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
|
||||
\ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
|
||||
|
@ -289,38 +289,38 @@ Execute(The javac callback should include src/test/java for test paths):
|
|||
call ale#engine#Cleanup(bufnr(''))
|
||||
" The test path is only included for test files.
|
||||
" Regular Java files shouldn't import from tests.
|
||||
noautocmd e! java_paths/src/test/java/com/something/dummy
|
||||
noautocmd e! ../test-files/java/with_main/src/test/java/com/something/dummy
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths/src/test/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_main/src/test/java/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
||||
Execute(The javac callback should include src/main/jaxb when available):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
noautocmd e! java_paths_with_jaxb/src/main/java/com/something/dummy
|
||||
noautocmd e! ../test-files/java/with_jaxb/src/main/java/com/something/dummy
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_jaxb/src/main/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/with_jaxb/src/main/jaxb/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
||||
Execute(The javac callback should add -sourcepath even if src/java/main doesn't exist):
|
||||
call ale#engine#Cleanup(bufnr(''))
|
||||
call ale#test#SetFilename('java_paths_no_main/src/test/java/com/something/dummy.java')
|
||||
call ale#test#SetFilename('../test-files/java/no_main/src/test/java/com/something/dummy.java')
|
||||
call ale#engine#InitBufferInfo(bufnr(''))
|
||||
|
||||
AssertLinter 'javac',
|
||||
\ ale#Escape('javac') . ' -Xlint'
|
||||
\ . ' -sourcepath ' . ale#Escape(join([
|
||||
\ ale#path#Simplify(g:dir . '/java_paths_no_main/src/test/java/'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/java/no_main/src/test/java/'),
|
||||
\ ], g:cp_sep))
|
||||
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
|
||||
|
|
|
@ -8,9 +8,9 @@ Execute(The default command should be correct):
|
|||
AssertLinter 'tsserver', ale#Escape('tsserver')
|
||||
|
||||
Execute(should resolve correct path when nested 1):
|
||||
call ale#test#SetFilename('tsserver_paths/src/level-1/level-2/file3.ts')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/tsserver_paths/src/level-1')
|
||||
call ale#test#SetFilename('../test-files/tsserver/src/level-1/level-2/file3.ts')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/tsserver/src/level-1')
|
||||
|
||||
Execute(should resolve correct path when nested 2):
|
||||
call ale#test#SetFilename('tsserver_paths/src/file1.ts')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/tsserver_paths')
|
||||
call ale#test#SetFilename('../test-files/tsserver/src/file1.ts')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/tsserver')
|
||||
|
|
|
@ -25,6 +25,6 @@ Execute(The executable should be configurable):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('julia-languageserver-project/test.jl')
|
||||
call ale#test#SetFilename('../test-files/julia/test.jl')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/julia-languageserver-project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/julia')
|
||||
|
|
|
@ -6,3 +6,18 @@ After:
|
|||
|
||||
Execute(The default command should be correct):
|
||||
AssertLinter 'kotlin-language-server', ale#Escape('kotlin-language-server')
|
||||
|
||||
Execute(Gradle project roots with build.gradle should be detected correctly):
|
||||
call ale#test#SetFilename('../test-files/gradle/build-gradle-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertLSPProject ale#test#GetFilename('../test-files/gradle/build-gradle-project')
|
||||
|
||||
Execute(Maven project roots with pom.xml should be detected correctly):
|
||||
call ale#test#SetFilename('../test-files/maven/maven-kotlin-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertLSPProject ale#test#GetFilename('../test-files/maven/maven-kotlin-project')
|
||||
|
||||
Execute(No root should be detected if configuration files can't be found):
|
||||
call ale#test#SetFilename('../test-files/gradle/non-gradle-project/src/main/kotlin/dummy.kt')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.less')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/stylelint_paths/node_modules/.bin/stylelint'
|
||||
\ . '/../test-files/stylelint/node_modules/.bin/stylelint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin-filename %s'
|
||||
|
@ -20,7 +20,7 @@ Execute(The global override should work):
|
|||
let b:ale_less_stylelint_executable = 'foobar'
|
||||
let b:ale_less_stylelint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.less')
|
||||
|
||||
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin-filename %s'
|
||||
|
||||
|
|
|
@ -10,29 +10,29 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('lessc_paths/nested/testfile.less')
|
||||
call ale#test#SetFilename('../test-files/lessc/nested/testfile.less')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/lessc_paths/node_modules/.bin/lessc'
|
||||
\ . '/../test-files/lessc/node_modules/.bin/lessc'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable)
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path='
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/lessc/nested'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(The global override should work):
|
||||
let b:ale_less_lessc_executable = 'foobar'
|
||||
let b:ale_less_lessc_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('lessc_paths/nested/testfile.less')
|
||||
call ale#test#SetFilename('../test-files/lessc/nested/testfile.less')
|
||||
|
||||
AssertLinter 'foobar', ale#Escape('foobar')
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path='
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/lessc/nested'))
|
||||
\ . ' -'
|
||||
|
||||
Execute(Extra options should be configurable):
|
||||
|
|
|
@ -35,39 +35,39 @@ Execute(The mypy command callback should let you set options):
|
|||
\ . ' --shadow-file %s %t %s'
|
||||
|
||||
Execute(The mypy command should switch directories to the detected project root):
|
||||
call ale#test#SetFilename('python_paths/no_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
|
||||
AssertLinter 'mypy',
|
||||
\ ale#Escape('mypy')
|
||||
\ . ' --show-column-numbers'
|
||||
\ . ' --shadow-file %s %t %s'
|
||||
|
||||
Execute(The mypy callbacks should detect virtualenv directories and switch to the project root):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy')
|
||||
let b:executable = ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/mypy')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter b:executable,
|
||||
\ ale#Escape(b:executable)
|
||||
\ . ' --show-column-numbers'
|
||||
\ . ' --shadow-file %s %t %s'
|
||||
|
||||
Execute(The mypy callbacks should cd to directory containing mypy.ini if found):
|
||||
call ale#test#SetFilename('python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_mypy_ini_and_pytest_ini')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_mypy_ini_and_pytest_ini')
|
||||
AssertLinter 'mypy',
|
||||
\ ale#Escape('mypy')
|
||||
\ . ' --show-column-numbers'
|
||||
\ . ' --shadow-file %s %t %s'
|
||||
|
||||
Execute(You should able able to use the global mypy instead):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
let g:ale_python_mypy_use_global = 1
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter 'mypy',
|
||||
\ ale#Escape('mypy')
|
||||
\ . ' --show-column-numbers'
|
||||
|
@ -82,7 +82,7 @@ Execute(Setting executable to 'pipenv' appends 'run mypy'):
|
|||
\ . ' --show-column-numbers --shadow-file %s %t %s'
|
||||
|
||||
Execute(Pipenv is detected when python_mypy_auto_pipenv is set):
|
||||
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
let g:ale_python_mypy_auto_pipenv = 1
|
||||
|
||||
AssertLinterCwd expand('#' . bufnr('') . ':p:h')
|
||||
|
|
|
@ -13,27 +13,27 @@ Execute(The project root should be detected correctly using compile_commands.jso
|
|||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.m')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.m')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.m')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.m')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.m')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls')
|
||||
|
||||
Execute(The project root should be detected correctly using .ccls-root file):
|
||||
call ale#test#SetFilename(tempname() . '/dummy.m')
|
||||
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.m')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls-root/dummy.m')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls-root')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'ccls', ale#Escape('ccls')
|
||||
|
@ -50,17 +50,17 @@ Execute(The initialization options should be configurable):
|
|||
AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' }
|
||||
|
||||
Execute(The compile command database should be detected correctly):
|
||||
call ale#test#SetFilename('ccls_paths/with_ccls/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.c')
|
||||
|
||||
AssertLSPOptions {}
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.c')
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json') }
|
||||
|
||||
call ale#test#SetFilename('ccls_paths/with_build_dir/dummy.c')
|
||||
call ale#test#SetFilename('../test-files/ccls/with_build_dir/dummy.c')
|
||||
let b:ale_c_build_dir_names = ['unusual_build_dir_name']
|
||||
|
||||
AssertLSPOptions { 'compilationDatabaseDirectory':
|
||||
\ ale#path#Simplify(g:dir . '/ccls_paths/with_build_dir/unusual_build_dir_name') }
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ccls/with_build_dir/unusual_build_dir_name') }
|
||||
|
|
|
@ -13,17 +13,17 @@ Execute(The language string should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ocamllsp_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ocamllsp/file.ml')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ocamllsp_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ocamllsp')
|
||||
|
||||
Execute(The executable should be run using opam exec by default):
|
||||
call ale#test#SetFilename('ocamllsp_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ocamllsp/file.ml')
|
||||
|
||||
AssertLinter 'ocamllsp', 'opam config exec -- ocamllsp'
|
||||
|
||||
Execute(The executable should be run directly if use_opam flag is disabled):
|
||||
let g:ale_ocaml_ocamllsp_use_opam = 0
|
||||
call ale#test#SetFilename('ocamllsp_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ocamllsp/file.ml')
|
||||
|
||||
AssertLinter 'ocamllsp', 'ocamllsp'
|
||||
|
|
|
@ -17,19 +17,19 @@ Execute(The default executable should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ols_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ols/file.ml')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ols_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ols')
|
||||
|
||||
Execute(The local executable should be used when available):
|
||||
call ale#test#SetFilename('ols_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ols/file.ml')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server')) . ' --stdio'
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/ols/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ols/node_modules/.bin/ocaml-language-server')) . ' --stdio'
|
||||
|
||||
Execute(The gloabl executable should always be used when use_global is set):
|
||||
let g:ale_ocaml_ols_use_global = 1
|
||||
call ale#test#SetFilename('ols_paths/file.ml')
|
||||
call ale#test#SetFilename('../test-files/ols/file.ml')
|
||||
|
||||
AssertLinter 'ocaml-language-server',
|
||||
\ ale#Escape('ocaml-language-server') . ' --stdio'
|
||||
|
|
|
@ -9,18 +9,18 @@ Execute(The default executable path should be correct):
|
|||
\ ale#Escape('intelephense') . ' --stdio'
|
||||
|
||||
Execute(The project path should be correct for .git directories):
|
||||
call ale#test#SetFilename('php-intelephense-project/with-git/test.php')
|
||||
silent! call mkdir('php-intelephense-project/with-git/.git', 'p')
|
||||
call ale#test#SetFilename('../test-files/php/with-git/test.php')
|
||||
silent! call mkdir('../test-files/php/with-git/.git', 'p')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/php-intelephense-project/with-git')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-git')
|
||||
|
||||
Execute(The project path should be correct for composer.json file):
|
||||
call ale#test#SetFilename('php-intelephense-project/with-composer/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/with-composer/test.php')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/php-intelephense-project/with-composer')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-composer')
|
||||
|
||||
Execute(The project cache should be saved in a temp dir):
|
||||
call ale#test#SetFilename('php-intelephense-project/with-composer/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/with-composer/test.php')
|
||||
let g:ale_php_intelephense_config = { 'storagePath': '/tmp/intelephense' }
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/php-intelephense-project/with-composer')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-composer')
|
||||
|
|
|
@ -9,22 +9,22 @@ Execute(The default executable path should be correct):
|
|||
\ 'php ' . ale#Escape('php-language-server.php')
|
||||
|
||||
Execute(Vendor executables should be detected):
|
||||
call ale#test#SetFilename('php-langserver-project/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/test.php')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/php/vendor/bin/php-language-server.php'),
|
||||
\ 'php ' . ale#Escape(ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/php-langserver-project/vendor/bin/php-language-server.php'
|
||||
\ . '/../test-files/php/vendor/bin/php-language-server.php'
|
||||
\ ))
|
||||
|
||||
Execute(The project path should be correct for .git directories):
|
||||
call ale#test#SetFilename('php-langserver-project/with-git/test.php')
|
||||
silent! call mkdir('php-langserver-project/with-git/.git')
|
||||
call ale#test#SetFilename('../test-files/php/with-git/test.php')
|
||||
silent! call mkdir('../test-files/php/with-git/.git')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/php-langserver-project/with-git')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-git')
|
||||
|
||||
Execute(The project path should be correct for composer.json file):
|
||||
call ale#test#SetFilename('php-langserver-project/with-composer/test.php')
|
||||
call ale#test#SetFilename('../test-files/php/with-composer/test.php')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/php-langserver-project/with-composer')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-composer')
|
||||
|
|
|
@ -7,9 +7,9 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The local phpcs executable should be used):
|
||||
call ale#test#SetFilename('../phpcs-test-files/project-with-phpcs/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/phpcs/project-with-phpcs/foo/test.php')
|
||||
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../phpcs-test-files/project-with-phpcs/vendor/bin/phpcs')
|
||||
let g:executable = ale#path#Simplify(g:dir . '/../test-files/phpcs/project-with-phpcs/vendor/bin/phpcs')
|
||||
|
||||
AssertLinterCwd '%s:h'
|
||||
AssertLinter g:executable, ale#Escape(g:executable)
|
||||
|
@ -18,13 +18,13 @@ Execute(The local phpcs executable should be used):
|
|||
Execute(use_global should override local executable detection):
|
||||
let g:ale_php_phpcs_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('../phpcs-test-files/project-with-phpcs/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/phpcs/project-with-phpcs/foo/test.php')
|
||||
|
||||
AssertLinter 'phpcs', ale#Escape('phpcs')
|
||||
\ . ' -s --report=emacs --stdin-path=%s'
|
||||
|
||||
Execute(Projects without local executables should use the global one):
|
||||
call ale#test#SetFilename('../phpcs-test-files/project-without-phpcs/foo/test.php')
|
||||
call ale#test#SetFilename('../test-files/phpcs/project-without-phpcs/foo/test.php')
|
||||
|
||||
AssertLinter 'phpcs', ale#Escape('phpcs')
|
||||
\ . ' -s --report=emacs --stdin-path=%s'
|
||||
|
|
|
@ -13,7 +13,7 @@ Execute(Setting executable to 'pipenv' appends 'run prospector'):
|
|||
|
||||
Execute(Pipenv is detected when python_prospector_auto_pipenv is set):
|
||||
let g:ale_python_prospector_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run prospector'
|
||||
|
|
|
@ -16,13 +16,13 @@ Execute(The default executable path should be correct):
|
|||
\ ale#Escape('psalm') . ' --language-server'
|
||||
|
||||
Execute(Vendor executables should be detected):
|
||||
call ale#test#SetFilename('psalm-project/test.php')
|
||||
call ale#test#SetFilename('../test-files/psalm/test.php')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/psalm-project/vendor/bin/psalm'),
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/psalm/vendor/bin/psalm'),
|
||||
\ ale#Escape(ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/psalm-project/vendor/bin/psalm'
|
||||
\ . '/../test-files/psalm/vendor/bin/psalm'
|
||||
\ )) . ' --language-server'
|
||||
|
||||
let g:ale_php_psalm_use_global = 1
|
||||
|
@ -36,25 +36,3 @@ Execute(User provided options should be used):
|
|||
AssertLinter 'psalm',
|
||||
\ ale#Escape('psalm')
|
||||
\ . ' --language-server --my-user-provided-option my-value'
|
||||
|
||||
Execute(The project path should be correct for .git directories):
|
||||
call ale#test#SetFilename('psalm-project/test.php')
|
||||
let g:matched = 0
|
||||
|
||||
for g:i in range(4)
|
||||
if !isdirectory(g:dir . '/.git')
|
||||
call mkdir(g:dir . '/.git')
|
||||
endif
|
||||
|
||||
try
|
||||
AssertLSPProject g:dir
|
||||
catch /.+/
|
||||
endtry
|
||||
|
||||
let g:matched = 1
|
||||
break
|
||||
endfor
|
||||
|
||||
if !g:matched
|
||||
AssertLSPProject g:dir
|
||||
endif
|
||||
|
|
|
@ -5,44 +5,44 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(puglint should detect local executables and package.json):
|
||||
call ale#test#SetFilename('puglint_project/test.pug')
|
||||
call ale#test#SetFilename('../test-files/puglint/test.pug')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ 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'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/package.json'))
|
||||
\ . ' -r inline %t'
|
||||
|
||||
Execute(puglint should use global executables if configured):
|
||||
let g:ale_pug_puglint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('puglint_project/test.pug')
|
||||
call ale#test#SetFilename('../test-files/puglint/test.pug')
|
||||
|
||||
AssertLinter 'pug-lint',
|
||||
\ ale#Escape('pug-lint')
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/package.json'))
|
||||
\ . ' -r inline %t'
|
||||
|
||||
Execute(puglint should detect .pug-lintrc):
|
||||
call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')
|
||||
call ale#test#SetFilename('../test-files/puglint/puglint_rc_dir/subdir/test.pug')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ 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'))
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/puglint_rc_dir/.pug-lintrc'))
|
||||
\ . ' -r inline %t'
|
||||
|
||||
Execute(puglint should detect .pug-lintrc.js):
|
||||
call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')
|
||||
call ale#test#SetFilename('../test-files/puglint/puglint_rc_js_dir/subdir/test.pug')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ 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'))
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/puglint_rc_js_dir/.pug-lintrc.js'))
|
||||
\ . ' -r inline %t'
|
||||
|
||||
Execute(puglint should detect .pug-lintrc.json):
|
||||
call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')
|
||||
call ale#test#SetFilename('../test-files/puglint/puglint_rc_json_dir/subdir/test.pug')
|
||||
|
||||
AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
|
||||
\ 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'))
|
||||
AssertLinter ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/node_modules/.bin/pug-lint'))
|
||||
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/puglint/puglint_rc_json_dir/.pug-lintrc.json'))
|
||||
\ . ' -r inline %t'
|
||||
|
|
|
@ -8,22 +8,22 @@ Execute(should set correct defaults):
|
|||
AssertLinter 'purescript-language-server', ale#Escape('purescript-language-server') . ' --stdio'
|
||||
|
||||
Execute(should set correct LSP values):
|
||||
call ale#test#SetFilename('purescript_paths/spago/Foo.purs')
|
||||
call ale#test#SetFilename('../test-files/purescript/spago/Foo.purs')
|
||||
|
||||
AssertLSPLanguage 'purescript'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/purescript_paths/spago')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/purescript/spago')
|
||||
|
||||
Execute(should set correct project for bower):
|
||||
call ale#test#SetFilename('purescript_paths/bower/Foo.purs')
|
||||
call ale#test#SetFilename('../test-files/purescript/bower/Foo.purs')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/purescript_paths/bower')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/purescript/bower')
|
||||
|
||||
Execute(should set correct project for psc-package):
|
||||
call ale#test#SetFilename('purescript_paths/psc-package/Foo.purs')
|
||||
call ale#test#SetFilename('../test-files/purescript/psc-package/Foo.purs')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/purescript_paths/psc-package')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/purescript/psc-package')
|
||||
|
||||
Execute(should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -27,7 +27,7 @@ Execute(Setting executable to 'pipenv' appends 'run pycodestyle'):
|
|||
|
||||
Execute(Pipenv is detected when python_pycodestyle_auto_pipenv is set):
|
||||
let g:ale_python_pycodestyle_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run pycodestyle -'
|
||||
|
|
|
@ -28,6 +28,6 @@ Execute(Setting executable to 'pipenv' appends 'run pydocstyle'):
|
|||
|
||||
Execute(Pipenv is detected when python_pydocstyle_auto_pipenv is set):
|
||||
let g:ale_python_pydocstyle_auto_pipenv = 1
|
||||
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run pydocstyle %s:t'
|
||||
|
|
|
@ -17,16 +17,16 @@ Execute(The pyflakes executable should be configurable):
|
|||
\ ale#Escape('~/.local/bin/pyflakes') . ' %t'
|
||||
|
||||
Execute(The pyflakes executable should be run from the virtualenv path):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyflakes'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pyflakes'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' %t'
|
||||
|
||||
Execute(You should be able to override the pyflakes virtualenv lookup):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let g:ale_python_pyflakes_use_global = 1
|
||||
|
||||
|
@ -40,7 +40,7 @@ Execute(Setting executable to 'pipenv' appends 'run pyflakes'):
|
|||
|
||||
Execute(Pipenv is detected when python_pyflakes_auto_pipenv is set):
|
||||
let g:ale_python_pyflakes_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run pyflakes %t'
|
||||
|
|
|
@ -36,31 +36,31 @@ Execute(The pylama command callback should let you set options):
|
|||
AssertLinter 'pylama', ale#Escape('pylama') . ' --some-option' . b:command_tail
|
||||
|
||||
Execute(The pylama command callback should switch directories to the detected project root):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py')
|
||||
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
|
||||
AssertLinter 'pylama', ale#Escape('pylama') . b:command_tail
|
||||
|
||||
Execute(The pylama command callback shouldn't detect virtualenv directories where they don't exist):
|
||||
call ale#test#SetFilename('python_paths/no_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
|
||||
AssertLinter 'pylama', ale#Escape('pylama') . b:command_tail
|
||||
|
||||
Execute(The pylama command callback should detect virtualenv directories and switch to the project root):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylama'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pylama'
|
||||
\)
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:command_tail
|
||||
|
||||
Execute(You should able able to use the global pylama instead):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
let g:ale_python_pylama_use_global = 1
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter 'pylama', ale#Escape('pylama') . b:command_tail
|
||||
|
||||
Execute(Setting executable to 'pipenv' appends 'run pylama'):
|
||||
|
@ -71,6 +71,6 @@ Execute(Setting executable to 'pipenv' appends 'run pylama'):
|
|||
|
||||
Execute(Pipenv is detected when python_pylama_auto_pipenv is set):
|
||||
let g:ale_python_pylama_auto_pipenv = 1
|
||||
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run pylama' . b:command_tail
|
||||
|
|
|
@ -44,25 +44,25 @@ Execute(The pylint command callback should let you set options):
|
|||
AssertLinter 'pylint', ale#Escape('pylint') . ' --some-option' . b:command_tail
|
||||
|
||||
Execute(The pylint callbacks shouldn't detect virtualenv directories where they don't exist):
|
||||
call ale#test#SetFilename('python_paths/no_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir')
|
||||
AssertLinter 'pylint', ale#Escape('pylint') . b:command_tail
|
||||
|
||||
Execute(The pylint callbacks should detect virtualenv directories):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylint'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pylint'
|
||||
\)
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . b:command_tail
|
||||
|
||||
Execute(You should able able to use the global pylint instead):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
let g:ale_python_pylint_use_global = 1
|
||||
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir')
|
||||
AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/subdir')
|
||||
AssertLinter 'pylint', ale#Escape('pylint') . b:command_tail
|
||||
|
||||
Execute(Setting executable to 'pipenv' appends 'run pylint'):
|
||||
|
@ -74,7 +74,7 @@ Execute(Setting executable to 'pipenv' appends 'run pylint'):
|
|||
|
||||
Execute(Pipenv is detected when python_pylint_auto_pipenv is set):
|
||||
let g:ale_python_pylint_auto_pipenv = 1
|
||||
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinterCwd expand('%:p:h')
|
||||
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run pylint'
|
||||
|
|
|
@ -23,17 +23,17 @@ Execute(The pyls command callback should let you set options):
|
|||
AssertLinter 'pyls', ale#Escape('pyls') . ' --some-option'
|
||||
|
||||
Execute(The pyls executable should be run from the virtualenv path):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyls'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pyls'
|
||||
\)
|
||||
|
||||
AssertEqual ale#Escape(b:executable),
|
||||
\ ale_linters#python#pyls#GetCommand(bufnr(''))
|
||||
|
||||
Execute(You should be able to override the pyls virtualenv lookup):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let g:ale_python_pyls_use_global = 1
|
||||
|
||||
|
@ -46,7 +46,7 @@ Execute(Setting executable to 'pipenv' appends 'run pyls'):
|
|||
|
||||
Execute(Pipenv is detected when python_pyls_auto_pipenv is set):
|
||||
let g:ale_python_pyls_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run pyls'
|
||||
|
|
|
@ -17,16 +17,16 @@ Execute(The pyre executable should be configurable):
|
|||
\ ale#Escape('~/.local/bin/pyre') . ' persistent'
|
||||
|
||||
Execute(The pyre executable should be run from the virtualenv path):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyre'
|
||||
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/pyre'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' persistent'
|
||||
|
||||
Execute(You should be able to override the pyre virtualenv lookup):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let g:ale_python_pyre_use_global = 1
|
||||
|
||||
|
@ -40,7 +40,7 @@ Execute(Setting executable to 'pipenv' appends 'run pyre'):
|
|||
|
||||
Execute(Pipenv is detected when python_pyre_auto_pipenv is set):
|
||||
let g:ale_python_pyre_auto_pipenv = 1
|
||||
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py')
|
||||
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
||||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run pyre persistent'
|
||||
|
|
|
@ -31,17 +31,17 @@ Execute(The default configuration should be mostly empty):
|
|||
AssertLSPConfig {'python': {}}
|
||||
|
||||
Execute(virtualenv paths should be set in configuration by default):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLSPConfig {
|
||||
\ 'python': {
|
||||
\ 'pythonPath': ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/python'),
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env'),
|
||||
\ 'pythonPath': ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/python'),
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env'),
|
||||
\ },
|
||||
\}
|
||||
|
||||
Execute(The pythonPath should be set based on whatever the ovveride for the venvPath is set to):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
" This overrides the default detection of the path.
|
||||
let b:ale_python_pyright_config = {
|
||||
|
@ -58,7 +58,7 @@ Execute(The pythonPath should be set based on whatever the ovveride for the venv
|
|||
\}
|
||||
|
||||
Execute(You should be able to override pythonPath when venvPath is detected):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
" This overrides the default detection of the path.
|
||||
let b:ale_python_pyright_config = {
|
||||
|
@ -70,12 +70,12 @@ Execute(You should be able to override pythonPath when venvPath is detected):
|
|||
AssertLSPConfig {
|
||||
\ 'python': {
|
||||
\ 'pythonPath': '/bin/python',
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env'),
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env'),
|
||||
\ },
|
||||
\}
|
||||
|
||||
Execute(You should be able to override both pythonPath and venvPath):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
" This overrides the default detection of the path.
|
||||
let b:ale_python_pyright_config = {
|
||||
|
@ -93,7 +93,7 @@ Execute(You should be able to override both pythonPath and venvPath):
|
|||
\}
|
||||
|
||||
Execute(You should be able to define other settings):
|
||||
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
let b:ale_python_pyright_config = {
|
||||
\ 'python': {
|
||||
|
@ -107,8 +107,8 @@ Execute(You should be able to define other settings):
|
|||
AssertLSPConfig {
|
||||
\ 'python': {
|
||||
\ 'analysis': {'logLevel': 'warning'},
|
||||
\ 'pythonPath': ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/python'),
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env'),
|
||||
\ 'pythonPath': ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/python'),
|
||||
\ 'venvPath': ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env'),
|
||||
\ },
|
||||
\ 'pyright': {
|
||||
\ 'disableLanguageServices': v:true,
|
||||
|
|
|
@ -10,9 +10,9 @@ Execute(The default executable path should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject '.'
|
||||
|
||||
call ale#test#SetFilename('r_paths/dummy/test.R')
|
||||
call ale#test#SetFilename('../test-files/r/dummy/test.R')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/r_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/r')
|
||||
|
||||
Execute(Should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('ruby', 'rails_best_practices')
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
||||
|
||||
let b:args = '--silent -f json'
|
||||
\ . ' --output-file ' . (has('win32') ? '%t' : '/dev/stdout')
|
||||
let b:app_path = ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')
|
||||
let b:app_path = ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app')
|
||||
let b:suffix = has('win32') ? '; type %t' : ''
|
||||
|
||||
After:
|
||||
|
@ -37,6 +37,6 @@ Execute(Setting bundle appends 'exec rails_best_practices'):
|
|||
\ . b:suffix
|
||||
|
||||
Execute(Command callback should be empty when not in a valid Rails app):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/test.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/test.rb')
|
||||
|
||||
AssertLinter 'rails_best_practices', ''
|
||||
|
|
|
@ -16,6 +16,6 @@ Execute(There should be no default project root):
|
|||
AssertLSPProject ''
|
||||
|
||||
Execute(The project root should be detected using bsconfig.json):
|
||||
call ale#test#SetFilename('reason_ls_paths/test.ml')
|
||||
call ale#test#SetFilename('../test-files/reasonml/test.ml')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/reason_ls_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/reasonml')
|
||||
|
|
|
@ -17,20 +17,20 @@ Execute(The default executable should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('ols_paths/file.re')
|
||||
call ale#test#SetFilename('../test-files/ols/file.re')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/ols_paths')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ols')
|
||||
|
||||
Execute(The local executable should be used when available):
|
||||
call ale#test#SetFilename('ols_paths/file.re')
|
||||
call ale#test#SetFilename('../test-files/ols/file.re')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server')) . ' --stdio'
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/ols/node_modules/.bin/ocaml-language-server'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ols/node_modules/.bin/ocaml-language-server')) . ' --stdio'
|
||||
|
||||
Execute(The gloabl executable should always be used when use_global is set):
|
||||
let g:ale_reason_ols_use_global = 1
|
||||
call ale#test#SetFilename('ols_paths/file.re')
|
||||
call ale#test#SetFilename('../test-files/ols/file.re')
|
||||
|
||||
AssertLinter 'ocaml-language-server',
|
||||
\ ale#Escape('ocaml-language-server') . ' --stdio'
|
||||
|
|
|
@ -22,16 +22,16 @@ Execute(The options should be configurable):
|
|||
\ ale#Escape('remark') . ' --something --no-stdout --no-color'
|
||||
|
||||
Execute(The local executable from .bin should be used if available):
|
||||
call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md')
|
||||
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'))
|
||||
\ . ' --no-stdout --no-color'
|
||||
|
||||
Execute(The global executable should be uesd if the option is set):
|
||||
let b:ale_markdown_remark_lint_use_global = 1
|
||||
call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md')
|
||||
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
|
||||
|
||||
AssertLinter 'remark', ale#Escape('remark')
|
||||
\ . ' --no-stdout --no-color'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
" Author: jD91mZM2 <me@krake.one>
|
||||
" Description: Tests for rnix-lsp language client
|
||||
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('nix', 'rnix_lsp')
|
||||
|
||||
|
@ -8,7 +7,6 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(should start rnix-lsp):
|
||||
call ale#test#SetFilename('./test.nix')
|
||||
AssertLSPLanguage 'nix'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify('.')
|
|
@ -42,24 +42,24 @@ Execute(The options should be configurable):
|
|||
\ ale#Escape('textlint') . ' --something -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from .bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_bin_path/foo.txt')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from textlint/bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_textlint_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_textlint_bin_path/foo.txt')
|
||||
|
||||
if has('win32')
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
else
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
endif
|
||||
|
|
|
@ -15,28 +15,28 @@ Execute(command callback executable can be overridden):
|
|||
AssertLinter 'foobar', ale#Escape('foobar') . ' stdio'
|
||||
|
||||
Execute(should set solargraph for rails app):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/models/thing.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/models/thing.rb')
|
||||
AssertLSPLanguage 'ruby'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../ruby_fixtures/valid_rails_app')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/ruby/valid_rails_app')
|
||||
|
||||
Execute(should set solargraph for ruby app1):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_ruby_app1/lib/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_ruby_app1/lib/file.rb')
|
||||
AssertLSPLanguage 'ruby'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../ruby_fixtures/valid_ruby_app1')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/ruby/valid_ruby_app1')
|
||||
|
||||
Execute(should set solargraph for ruby app2):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_ruby_app2/lib/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_ruby_app2/lib/file.rb')
|
||||
AssertLSPLanguage 'ruby'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../ruby_fixtures/valid_ruby_app2')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/ruby/valid_ruby_app2')
|
||||
|
||||
Execute(should set solargraph for ruby app3):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_ruby_app3/lib/file.rb')
|
||||
call ale#test#SetFilename('../test-files/ruby/valid_ruby_app3/lib/file.rb')
|
||||
AssertLSPLanguage 'ruby'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../ruby_fixtures/valid_ruby_app3')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/ruby/valid_ruby_app3')
|
||||
|
||||
Execute(should accept initialization options):
|
||||
AssertLSPOptions {}
|
||||
|
|
|
@ -10,9 +10,9 @@ Execute(The default executable path should be correct):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('rust-rls-project/test.rs')
|
||||
call ale#test#SetFilename('../test-files/rust/test.rs')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/rust-rls-project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust')
|
||||
|
||||
Execute(Should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -20,9 +20,9 @@ Execute(The toolchain should be ommitted if not given):
|
|||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
||||
call ale#test#SetFilename('rust-rls-project/test.rs')
|
||||
call ale#test#SetFilename('../test-files/rust/test.rs')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/rust-rls-project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust')
|
||||
|
||||
Execute(Should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -13,9 +13,9 @@ Execute(The options should be configurable):
|
|||
AssertLinter 'rustc', 'rustc --error-format=json --foo -'
|
||||
|
||||
Execute(Some default paths should be included when the project is a Cargo project):
|
||||
call ale#test#SetFilename('cargo_paths/test.rs')
|
||||
call ale#test#SetFilename('../test-files/cargo/test.rs')
|
||||
|
||||
AssertLinter 'rustc', 'rustc --error-format=json -Z no-codegen'
|
||||
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, 'cargo_paths/target/debug/deps'))
|
||||
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, 'cargo_paths/target/release/deps'))
|
||||
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, '../test-files/cargo/target/debug/deps'))
|
||||
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, '../test-files/cargo/target/release/deps'))
|
||||
\ . ' -'
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(should default to source, bin/sass-lint.js):
|
||||
call ale#test#SetFilename('sasslint-test-files/with-source/test.sass')
|
||||
call ale#test#SetFilename('../test-files/sasslint/with-source/test.sass')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/sasslint-test-files/with-source/node_modules/sass-lint/bin/sass-lint.js'
|
||||
\ . '/../test-files/sasslint/with-source/node_modules/sass-lint/bin/sass-lint.js'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable,
|
||||
|
@ -20,11 +20,11 @@ Execute(should default to source, bin/sass-lint.js):
|
|||
\ . ' -v -q -f compact %t'
|
||||
|
||||
Execute(should fallback to bin, .bin/sass-lint):
|
||||
call ale#test#SetFilename('sasslint-test-files/with-bin/test.sass')
|
||||
call ale#test#SetFilename('../test-files/sasslint/with-bin/test.sass')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/sasslint-test-files/with-bin/node_modules/.bin/sass-lint'
|
||||
\ . '/../test-files/sasslint/with-bin/node_modules/.bin/sass-lint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' -v -q -f compact %t'
|
||||
|
|
|
@ -7,13 +7,13 @@ Before:
|
|||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
Execute(should set metals for sbt project with build.sbt):
|
||||
call ale#test#SetFilename('../scala_fixtures/valid_sbt_project/Main.scala')
|
||||
call ale#test#SetFilename('../test-files/scala/valid_sbt_project/Main.scala')
|
||||
AssertLSPLanguage 'scala'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../scala_fixtures/valid_sbt_project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/scala/valid_sbt_project')
|
||||
Execute(should not set metals for sbt project without build.sbt):
|
||||
call ale#test#SetFilename('../scala_fixtures/invalid_sbt_project/Main.scala')
|
||||
call ale#test#SetFilename('../test-files/scala/invalid_sbt_project/Main.scala')
|
||||
AssertLSPLanguage 'scala'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -6,14 +6,14 @@ Before:
|
|||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
Execute(should set sbtserver for sbt project with build.sbt):
|
||||
call ale#test#SetFilename('../scala_fixtures/valid_sbt_project/Main.scala')
|
||||
call ale#test#SetFilename('../test-files/scala/valid_sbt_project/Main.scala')
|
||||
AssertLSPLanguage 'scala'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../scala_fixtures/valid_sbt_project')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../test-files/scala/valid_sbt_project')
|
||||
AssertLSPAddress '127.0.0.1:4273'
|
||||
Execute(should not set sbtserver for sbt project without build.sbt):
|
||||
call ale#test#SetFilename('../scala_fixtures/invalid_sbt_project/Main.scala')
|
||||
call ale#test#SetFilename('../test-files/scala/invalid_sbt_project/Main.scala')
|
||||
AssertLSPLanguage 'scala'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(should default to source, bin/sass-lint.js):
|
||||
call ale#test#SetFilename('sasslint-test-files/with-source/test.scss')
|
||||
call ale#test#SetFilename('../test-files/sasslint/with-source/test.scss')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/sasslint-test-files/with-source/node_modules/sass-lint/bin/sass-lint.js'
|
||||
\ . '/../test-files/sasslint/with-source/node_modules/sass-lint/bin/sass-lint.js'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable,
|
||||
|
@ -20,11 +20,11 @@ Execute(should default to source, bin/sass-lint.js):
|
|||
\ . ' -v -q -f compact %t'
|
||||
|
||||
Execute(should fallback to bin, .bin/sass-lint):
|
||||
call ale#test#SetFilename('sasslint-test-files/with-bin/test.scss')
|
||||
call ale#test#SetFilename('../test-files/sasslint/with-bin/test.scss')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/sasslint-test-files/with-bin/node_modules/.bin/sass-lint'
|
||||
\ . '/../test-files/sasslint/with-bin/node_modules/.bin/sass-lint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' -v -q -f compact %t'
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.scss')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.scss')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/stylelint_paths/node_modules/.bin/stylelint'
|
||||
\ . '/../test-files/stylelint/node_modules/.bin/stylelint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin-filename %s'
|
||||
|
@ -20,7 +20,7 @@ Execute(The global override should work):
|
|||
let b:ale_scss_stylelint_executable = 'foobar'
|
||||
let b:ale_scss_stylelint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.scss')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.scss')
|
||||
|
||||
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin-filename %s'
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@ Execute(The default command should be correct):
|
|||
AssertLinter 'slim-lint', 'slim-lint %t'
|
||||
|
||||
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')
|
||||
call ale#test#SetFilename('../test-files/slimlint/subdir/file.slim')
|
||||
|
||||
AssertLinter 'slim-lint',
|
||||
\ ale#Env(
|
||||
\ 'SLIM_LINT_RUBOCOP_CONF',
|
||||
\ ale#path#Simplify(g:dir . '/../slimlint-test-files/.rubocop.yml')
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/slimlint/.rubocop.yml')
|
||||
\ )
|
||||
\ . 'slim-lint %t'
|
||||
|
|
|
@ -23,9 +23,9 @@ Execute(The yaml spectral command callback should allow a global installation to
|
|||
\ . ' lint --ignore-unknown-format -q -f text %t'
|
||||
|
||||
Execute(The yaml spectral command callback should allow a local installation to be used):
|
||||
call ale#test#SetFilename('spectral_paths/openapi.yaml')
|
||||
call ale#test#SetFilename('../test-files/spectral/openapi.yaml')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/spectral_paths/node_modules/.bin/spectral'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/spectral_paths/node_modules/.bin/spectral'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/spectral/node_modules/.bin/spectral'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/spectral/node_modules/.bin/spectral'))
|
||||
\ . ' lint --ignore-unknown-format -q -f text %t'
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(bin/cmd.js paths should be preferred):
|
||||
call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/standard/with-cmd/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js'
|
||||
\ . '/../test-files/standard/with-cmd/node_modules/standard/bin/cmd.js'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable,
|
||||
|
@ -20,11 +20,11 @@ Execute(bin/cmd.js paths should be preferred):
|
|||
\ . ' --stdin %s'
|
||||
|
||||
Execute(.bin directories should be used too):
|
||||
call ale#test#SetFilename('standard-test-files/with-bin/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/standard/with-bin/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-bin/node_modules/.bin/standard'
|
||||
\ . '/../test-files/standard/with-bin/node_modules/.bin/standard'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin %s'
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(bin/cmd.js paths should be preferred):
|
||||
call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/standard/with-cmd/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js'
|
||||
\ . '/../test-files/standard/with-cmd/node_modules/standard/bin/cmd.js'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable,
|
||||
|
@ -20,11 +20,11 @@ Execute(bin/cmd.js paths should be preferred):
|
|||
\ . ' --stdin %s'
|
||||
|
||||
Execute(.bin directories should be used too):
|
||||
call ale#test#SetFilename('standard-test-files/with-bin/testfile.js')
|
||||
call ale#test#SetFilename('../test-files/standard/with-bin/testfile.js')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/standard-test-files/with-bin/node_modules/.bin/standard'
|
||||
\ . '/../test-files/standard/with-bin/node_modules/.bin/standard'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin %s'
|
||||
|
|
|
@ -7,11 +7,11 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(node_modules directories should be discovered):
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.sss')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.sss')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir
|
||||
\ . '/stylelint_paths/node_modules/.bin/stylelint'
|
||||
\ . '/../test-files/stylelint/node_modules/.bin/stylelint'
|
||||
\)
|
||||
|
||||
AssertLinter b:executable, ale#Escape(b:executable) . ' --syntax=sugarss --stdin-filename %s'
|
||||
|
@ -20,7 +20,7 @@ Execute(The global override should work):
|
|||
let b:ale_sugarss_stylelint_executable = 'foobar'
|
||||
let b:ale_sugarss_stylelint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('stylelint_paths/nested/testfile.sss')
|
||||
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.sss')
|
||||
|
||||
AssertLinter 'foobar', ale#Escape('foobar') . ' --syntax=sugarss --stdin-filename %s'
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ Execute(The yaml swaglint command callback should allow a global installation to
|
|||
\ ale#Escape('/usr/local/bin/swaglint') . ' -r compact --stdin'
|
||||
|
||||
Execute(The yaml swaglint command callback should allow a local installation to be used):
|
||||
call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml')
|
||||
call ale#test#SetFilename('../test-files/swaglint/docs/swagger.yaml')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/swaglint/node_modules/.bin/swaglint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/swaglint/node_modules/.bin/swaglint'))
|
||||
\ . ' -r compact --stdin'
|
||||
|
|
|
@ -5,12 +5,12 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default executable path should be correct):
|
||||
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
|
||||
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
|
||||
|
||||
AssertLinter 'sourcekit-lsp', ale#Escape('sourcekit-lsp')
|
||||
|
||||
Execute(Should let users configure a global executable and override local paths):
|
||||
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
|
||||
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
|
||||
|
||||
let g:ale_sourcekit_lsp_executable = '/path/to/custom/sourcekitlsp'
|
||||
|
||||
|
|
|
@ -5,19 +5,19 @@ After:
|
|||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Should use default command when not in a swift package):
|
||||
call ale#test#SetFilename('../swift-test-files/non-swift-package-project/src/folder/dummy.swift')
|
||||
call ale#test#SetFilename('../test-files/swift/non-swift-package-project/src/folder/dummy.swift')
|
||||
|
||||
AssertLinter 'swift-format',
|
||||
\ ale#Escape('swift-format') . ' --mode lint %t'
|
||||
|
||||
Execute(Should use swift run when in a swift package):
|
||||
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
|
||||
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
|
||||
|
||||
AssertLinter 'swift',
|
||||
\ ale#Escape('swift') . ' run swift-format --mode lint %t'
|
||||
|
||||
Execute(Should let users configure a global executable and override local paths):
|
||||
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
|
||||
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
|
||||
|
||||
let g:ale_swift_swiftformat_executable = '/path/to/custom/swift-format'
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('swift', 'swiftlint')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(Global installation should be the default executable):
|
||||
call ale#test#SetFilename('../test-files/swiftlint/global/testfile.swift')
|
||||
|
||||
AssertEqual
|
||||
\ 'swiftlint',
|
||||
\ ale_linters#swift#swiftlint#GetExecutable(bufnr(''))
|
||||
|
||||
Execute(React Native apps using CocoaPods should take precedence over the default executable):
|
||||
call ale#test#SetFilename('../test-files/swiftlint/react-native/testfile.swift')
|
||||
|
||||
AssertEqual
|
||||
\ tolower(ale#test#GetFilename('../test-files/swiftlint/react-native/ios/Pods/SwiftLint/swiftlint')),
|
||||
\ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr('')))
|
||||
|
||||
Execute(CocoaPods installation should take precedence over the default executable):
|
||||
call ale#test#SetFilename('../test-files/swiftlint/cocoapods/testfile.swift')
|
||||
|
||||
AssertEqual
|
||||
\ tolower(ale#test#GetFilename('../test-files/swiftlint/cocoapods/Pods/SwiftLint/swiftlint')),
|
||||
\ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr('')))
|
||||
|
||||
Execute(Top level CocoaPods installation should take precedence over React Native installation):
|
||||
call ale#test#SetFilename('../test-files/swiftlint/cocoapods-and-react-native/testfile.swift')
|
||||
|
||||
AssertEqual
|
||||
\ tolower(ale#test#GetFilename('../test-files/swiftlint/cocoapods-and-react-native/Pods/SwiftLint/swiftlint')),
|
||||
\ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr('')))
|
||||
|
||||
Execute(use-global should override other versions):
|
||||
let g:ale_swift_swiftlint_use_global = 1
|
||||
let g:ale_swift_swiftlint_executable = 'swiftlint_d'
|
||||
|
||||
call ale#test#SetFilename('../test-files/swiftlint/cocoapods-and-react-native/testfile.swift')
|
||||
|
||||
AssertEqual
|
||||
\ 'swiftlint_d',
|
||||
\ ale_linters#swift#swiftlint#GetExecutable(bufnr(''))
|
|
@ -45,7 +45,7 @@ Execute(Should return current directory if it contains .terraform directory):
|
|||
AssertLSPProject g:dir
|
||||
|
||||
Execute(Should return nearest directory with .terraform if found in parent directory):
|
||||
call ale#test#SetFilename('../terraform_files/main.tf')
|
||||
call ale#test#SetFilename('../test-files/terraform/main.tf')
|
||||
|
||||
let b:parent_dir = ale#path#Simplify(g:dir . '/..')
|
||||
let b:tf_dir = b:parent_dir . '/.terraform'
|
||||
|
|
|
@ -32,7 +32,7 @@ Execute(Should return current directory if it contains .terraform directory):
|
|||
AssertLSPProject g:dir
|
||||
|
||||
Execute(Should return nearest directory with .terraform if found in parent directory):
|
||||
call ale#test#SetFilename('../terraform_files/main.tf')
|
||||
call ale#test#SetFilename('../test-files/terraform/main.tf')
|
||||
|
||||
let b:parent_dir = ale#path#Simplify(g:dir . '/..')
|
||||
let b:tf_dir = b:parent_dir . '/.terraform'
|
||||
|
|
|
@ -19,10 +19,10 @@ Execute(Overriding options should work):
|
|||
AssertLinter 'fnord', ale#Escape('fnord') . ' --whatever -f json %t'
|
||||
|
||||
Execute(Configuration files should be found):
|
||||
call ale#test#SetFilename('../tflint-test-files/foo/bar.tf')
|
||||
call ale#test#SetFilename('../test-files/tflint/foo/bar.tf')
|
||||
|
||||
AssertLinter 'tflint',
|
||||
\ ale#Escape('tflint')
|
||||
\ . ' --config '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../tflint-test-files/foo/.tflint.hcl'))
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/tflint/foo/.tflint.hcl'))
|
||||
\ . ' -f json %t'
|
||||
|
|
|
@ -42,24 +42,24 @@ Execute(The options should be configurable):
|
|||
\ ale#Escape('textlint') . ' --something -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from .bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_bin_path/foo.txt')
|
||||
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_bin_path/node_modules/.bin/textlint'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
|
||||
Execute(The local executable from textlint/bin should be used if available):
|
||||
call ale#test#SetFilename('textlint_paths/with_textlint_bin_path/foo.txt')
|
||||
call ale#test#SetFilename('../test-files/textlint/with_textlint_bin_path/foo.txt')
|
||||
|
||||
if has('win32')
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape('node.exe') . ' ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
else
|
||||
AssertLinter
|
||||
\ ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/textlint_paths/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'),
|
||||
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/textlint/with_textlint_bin_path/node_modules/textlint/bin/textlint.js'))
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue