mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 13:32:34 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
0
test/command_callback/html_beautify_paths/html-beautify
Executable file
0
test/command_callback/html_beautify_paths/html-beautify
Executable file
0
test/command_callback/html_beautify_paths/test.html
Normal file
0
test/command_callback/html_beautify_paths/test.html
Normal file
@@ -7,7 +7,7 @@ After:
|
||||
Execute(The executable should be configurable):
|
||||
AssertLinter 'clang-check',
|
||||
\ ale#Escape('clang-check')
|
||||
\ . ' -analyze %s -extra-arg -Xclang -extra-arg -analyzer-output=text'
|
||||
\ . ' -analyze %s --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
|
||||
|
||||
let b:ale_cpp_clangcheck_executable = 'foobar'
|
||||
|
||||
@@ -15,7 +15,7 @@ Execute(The executable should be configurable):
|
||||
" being generated.
|
||||
AssertLinter 'foobar',
|
||||
\ ale#Escape('foobar')
|
||||
\ . ' -analyze %s -extra-arg -Xclang -extra-arg -analyzer-output=text'
|
||||
\ . ' -analyze %s --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
|
||||
|
||||
Execute(The options should be configurable):
|
||||
let b:ale_cpp_clangcheck_options = '--something'
|
||||
@@ -23,7 +23,7 @@ Execute(The options should be configurable):
|
||||
AssertLinter 'clang-check',
|
||||
\ ale#Escape('clang-check')
|
||||
\ . ' -analyze %s'
|
||||
\ . ' -extra-arg -Xclang -extra-arg -analyzer-output=text'
|
||||
\ . ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
|
||||
\ . ' --something'
|
||||
|
||||
Execute(The build directory should be used when set):
|
||||
|
||||
@@ -22,6 +22,14 @@ Execute(Vendor executables should be detected):
|
||||
\ . '/psalm-project/vendor/bin/psalm'
|
||||
\ )) . ' --language-server'
|
||||
|
||||
Execute(User provided options should be used):
|
||||
let g:ale_psalm_langserver_options = '--my-user-provided-option my-value'
|
||||
|
||||
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')
|
||||
|
||||
|
||||
16
test/fixers/test_html_beautify_fixer_callback.vader
Normal file
16
test/fixers/test_html_beautify_fixer_callback.vader
Normal file
@@ -0,0 +1,16 @@
|
||||
Before:
|
||||
call ale#assert#SetUpFixerTest('html', 'html-beautify', 'beautify')
|
||||
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
silent cd ..
|
||||
silent cd command_callback
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The html-beautify callback should return the correct default command):
|
||||
AssertEqual
|
||||
\ {'command': '''html-beautify'' -'},
|
||||
\ ale#fixers#html_beautify#Fix(bufnr(''))
|
||||
24
test/fixers/test_purty_fixer_callback.vader
Normal file
24
test/fixers/test_purty_fixer_callback.vader
Normal file
@@ -0,0 +1,24 @@
|
||||
Before:
|
||||
Save g:ale_purescript_purty_executable
|
||||
|
||||
" Use an invalid global executable, so we don't match it.
|
||||
let g:ale_purescript_purty_executable = 'my-special-purty'
|
||||
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(The purty callback should return the correct options):
|
||||
call ale#test#SetFilename('../purescript_files/testfile.purs')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('my-special-purty')
|
||||
\ . ' --write'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ },
|
||||
\ ale#fixers#purty#Fix(bufnr(''))
|
||||
@@ -1,17 +1,33 @@
|
||||
Before:
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
call ale#assert#SetUpFixerTest('css', 'stylelint')
|
||||
|
||||
After:
|
||||
call ale#test#RestoreDirectory()
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The executable path should be correct):
|
||||
Execute(The stylelint callback should return the correct default values):
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
|
||||
|
||||
AssertEqual
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': (has('win32') ? 'node.exe ' : '')
|
||||
\ 'command': ale#path#CdString(expand('%:p:h'))
|
||||
\ . (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
||||
\ . ' --fix %t',
|
||||
\ },
|
||||
\ ale#fixers#stylelint#Fix(bufnr(''))
|
||||
\ . ' %t'
|
||||
\ . ' --fix',
|
||||
\ }
|
||||
|
||||
Execute(The stylelint callback should include custom stylelint options):
|
||||
let g:ale_stylelint_options = '--cache'
|
||||
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
|
||||
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#path#CdString(expand('%:p:h'))
|
||||
\ . (has('win32') ? 'node.exe ' : '')
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
||||
\ . ' %t'
|
||||
\ . ' --cache'
|
||||
\ . ' --fix',
|
||||
\ }
|
||||
|
||||
@@ -32,7 +32,7 @@ Before:
|
||||
|
||||
function! CollectSigns()
|
||||
redir => l:output
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
silent exec 'sign place group=ale'
|
||||
else
|
||||
silent exec 'sign place'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Execute (Parsing English signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[9, 1000001, 'ALEWarningSign']]],
|
||||
\ ale#sign#ParseSigns([
|
||||
@@ -16,7 +16,7 @@ Execute (Parsing English signs should work):
|
||||
endif
|
||||
|
||||
Execute (Parsing Russian signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[1, 1000001, 'ALEErrorSign']]],
|
||||
\ ale#sign#ParseSigns([' строка=1 id=1000001 группа=ale имя=ALEErrorSign'])
|
||||
@@ -27,7 +27,7 @@ Execute (Parsing Russian signs should work):
|
||||
endif
|
||||
|
||||
Execute (Parsing Japanese signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
||||
\ ale#sign#ParseSigns([' 行=1 識別子=1000001 グループ=ale 名前=ALEWarningSign'])
|
||||
@@ -38,7 +38,7 @@ Execute (Parsing Japanese signs should work):
|
||||
endif
|
||||
|
||||
Execute (Parsing Spanish signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[12, 1000001, 'ALEWarningSign']]],
|
||||
\ ale#sign#ParseSigns([' línea=12 id=1000001 grupo=ale nombre=ALEWarningSign'])
|
||||
@@ -49,7 +49,7 @@ Execute (Parsing Spanish signs should work):
|
||||
endif
|
||||
|
||||
Execute (Parsing Italian signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
||||
\ ale#sign#ParseSigns([' riga=1 id=1000001, gruppo=ale nome=ALEWarningSign'])
|
||||
@@ -60,7 +60,7 @@ Execute (Parsing Italian signs should work):
|
||||
endif
|
||||
|
||||
Execute (Parsing German signs should work):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [0, [[235, 1000001, 'ALEErrorSign']]],
|
||||
\ ale#sign#ParseSigns([' Zeile=235 id=1000001 Gruppe=ale Name=ALEErrorSign'])
|
||||
@@ -71,7 +71,7 @@ Execute (Parsing German signs should work):
|
||||
endif
|
||||
|
||||
Execute (The sign parser should indicate if the dummy sign is set):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
AssertEqual
|
||||
\ [1, [[1, 1000001, 'ALEErrorSign']]],
|
||||
\ ale#sign#ParseSigns([
|
||||
|
||||
@@ -68,7 +68,7 @@ Before:
|
||||
|
||||
function! ParseSigns()
|
||||
redir => l:output
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
silent sign place group=ale
|
||||
else
|
||||
silent sign place
|
||||
@@ -152,7 +152,7 @@ Execute(The current signs should be set for running a job):
|
||||
\ ParseSigns()
|
||||
|
||||
Execute(Loclist items with sign_id values should be kept):
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
||||
exec 'sign place 1000348 group=ale line=15 name=ALEErrorSign buffer=' . bufnr('')
|
||||
exec 'sign place 1000349 group=ale line=16 name=ALEWarningSign buffer=' . bufnr('')
|
||||
@@ -297,7 +297,7 @@ Execute(No exceptions should be thrown when setting signs for invalid buffers):
|
||||
Execute(Signs should be removed when lines have multiple sign IDs on them):
|
||||
" We can fail to remove signs if there are multiple signs on one line,
|
||||
" say after deleting lines in Vim, etc.
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
||||
exec 'sign place 1000348 group=ale line=3 name=ALEWarningSign buffer=' . bufnr('')
|
||||
exec 'sign place 1000349 group=ale line=10 name=ALEErrorSign buffer=' . bufnr('')
|
||||
|
||||
Reference in New Issue
Block a user