Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
|
84004665d5 | ||
|
a1932b7ff5 | ||
|
a55f941349 | ||
|
80ac8ec69f | ||
|
e73baafd95 | ||
|
b4667a0432 | ||
|
80a16668c9 | ||
|
1f7679e619 | ||
|
964d3ab9ec |
41 changed files with 122 additions and 58 deletions
|
@ -1,13 +1,22 @@
|
|||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Follow-up checks for the plugin: warn about conflicting plugins.
|
||||
|
||||
" A flag for ensuring that this is not run more than one time.
|
||||
if exists('g:loaded_ale_after')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Set the flag so this file is not run more than one time.
|
||||
let g:loaded_ale_after = 1
|
||||
|
||||
if !g:ale_emit_conflict_warnings
|
||||
" Check if the flag is available and set to 0 to disable checking for and
|
||||
" emitting conflicting plugin warnings.
|
||||
if exists('g:ale_emit_conflict_warnings') && !g:ale_emit_conflict_warnings
|
||||
finish
|
||||
endif
|
||||
|
||||
" Conflicting Plugins Checks
|
||||
|
||||
function! s:GetConflictingPluginWarning(plugin_name) abort
|
||||
return 'ALE conflicts with ' . a:plugin_name
|
||||
\ . '. Uninstall it, or disable this warning with '
|
||||
|
|
|
@ -17,7 +17,6 @@ function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
|||
|
||||
let l:text = l:match[1]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
|
|
|
@ -32,15 +32,12 @@ function! ale_linters#coffee#coffeelint#Handle(buffer, lines) abort
|
|||
endif
|
||||
|
||||
let l:line = l:match[1] + 0
|
||||
let l:column = 1
|
||||
let l:type = l:match[3] ==# 'error' ? 'E' : 'W'
|
||||
let l:text = l:match[4]
|
||||
|
||||
" vcol is needed to indicate that the column is a character
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -68,7 +68,6 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
|||
let l:type = l:match[3]
|
||||
let l:text = l:match[4]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -23,7 +23,6 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
|||
let l:type = 'W'
|
||||
let l:text = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:lnum,
|
||||
|
|
|
@ -23,7 +23,6 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
|
|||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -73,7 +73,6 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
|||
let l:type = 'E'
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -7,7 +7,6 @@ function! ale_linters#haskell#hlint#Handle(buffer, lines) abort
|
|||
let l:output = []
|
||||
|
||||
for l:error in l:errors
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:error.startLine + 0,
|
||||
|
|
|
@ -49,7 +49,6 @@ function! ale_linters#html#tidy#Handle(buffer, lines) abort
|
|||
let l:type = l:match[3] ==# 'Error' ? 'E' : 'W'
|
||||
let l:text = l:match[4]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -34,7 +34,6 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
|
|||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': 1,
|
||||
\ 'text': l:match[2] . ':' . l:match[3],
|
||||
\ 'type': l:match[2] ==# 'error' ? 'E' : 'W',
|
||||
\})
|
||||
|
|
|
@ -76,7 +76,6 @@ function! ale_linters#javascript#eslint#Handle(buffer, lines) abort
|
|||
let l:text .= ' [' . l:match[4] . ']'
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -47,7 +47,6 @@ function! ale_linters#javascript#standard#Handle(buffer, lines) abort
|
|||
let l:type = 'Error'
|
||||
let l:text = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -14,7 +14,6 @@ function! ale_linters#json#jsonlint#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is needed to indicate that the column is a character
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -19,7 +19,6 @@ function! ale_linters#lua#luacheck#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -40,7 +40,6 @@ function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:lnum,
|
||||
|
|
|
@ -29,15 +29,12 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
|||
endif
|
||||
|
||||
let l:line = l:match[3]
|
||||
let l:column = 1
|
||||
let l:text = l:match[1]
|
||||
let l:type = 'E'
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -13,15 +13,12 @@ function! ale_linters#perl#perlcritic#Handle(buffer, lines) abort
|
|||
endif
|
||||
|
||||
let l:line = l:match[3]
|
||||
let l:column = 1
|
||||
let l:text = l:match[1]
|
||||
let l:type = 'E'
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
" Author: Spencer Wood <https://github.com/scwood>
|
||||
" Author: Spencer Wood <https://github.com/scwood>, Adriaan Zonnenberg <amz@adriaan.xyz>
|
||||
" Description: This file adds support for checking PHP with php-cli
|
||||
|
||||
function! ale_linters#php#php#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" PHP Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
|
||||
let l:pattern = '\vParse error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)'
|
||||
let l:pattern = '\vPHP %(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)'
|
||||
|
||||
let l:output = []
|
||||
|
||||
|
@ -16,7 +16,6 @@ function! ale_linters#php#php#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
|
|
|
@ -29,7 +29,6 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort
|
|||
let l:text = l:match[4]
|
||||
let l:type = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -18,7 +18,6 @@ function! ale_linters#php#phpmd#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -14,7 +14,6 @@ function! ale_linters#puppet#puppet#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is needed to indicate that the column is a character
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
|
|
|
@ -19,7 +19,6 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort
|
|||
let l:text = l:match[4]
|
||||
let l:type = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -23,13 +23,8 @@ function! ale_linters#scala#scalac#Handle(buffer, lines) abort
|
|||
|
||||
if l:ln + 1 < len(a:lines)
|
||||
let l:col = stridx(a:lines[l:ln + 1], '^')
|
||||
|
||||
if l:col == -1
|
||||
let l:col = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -20,7 +20,6 @@ function! ale_linters#scss#scsslint#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
" vcol is needed to indicate that the column is a character
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
|
|
|
@ -30,7 +30,7 @@ function! ale_linters#sh#shell#GetExecutable(buffer) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#sh#shell#GetCommand(buffer) abort
|
||||
return ale_linters#sh#shell#GetExecutable(a:buffer) . ' -n'
|
||||
return ale_linters#sh#shell#GetExecutable(a:buffer) . ' -n %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#sh#shell#Handle(buffer, lines) abort
|
||||
|
@ -38,7 +38,7 @@ function! ale_linters#sh#shell#Handle(buffer, lines) abort
|
|||
"
|
||||
" bash: line 13: syntax error near unexpected token `d'
|
||||
" sh: 11: Syntax error: "(" unexpected
|
||||
let l:pattern = '^[^:]\+: \%(\w\+ \|\)\(\d\+\): \(.\+\)'
|
||||
let l:pattern = '\v(line |: ?)(\d+): (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
|
@ -48,16 +48,13 @@ function! ale_linters#sh#shell#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
let l:line = l:match[1] + 0
|
||||
let l:column = 1
|
||||
let l:text = l:match[2]
|
||||
let l:line = l:match[2] + 0
|
||||
let l:text = l:match[3]
|
||||
let l:type = 'E'
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -23,7 +23,6 @@ function! ale_linters#sml#smlnj#Handle(buffer, lines) abort
|
|||
call add(l:out, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': 1,
|
||||
\ 'text': l:match[2] . ': ' . l:match[3],
|
||||
\ 'type': l:match[2] ==# 'error' ? 'E' : 'W',
|
||||
\})
|
||||
|
|
|
@ -37,7 +37,6 @@ function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
|
|||
let l:type = 'E'
|
||||
let l:text = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -22,7 +22,6 @@ function! ale_linters#typescript#typecheck#Handle(buffer, lines) abort
|
|||
let l:type = 'E'
|
||||
let l:text = l:match[3]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -25,7 +25,6 @@ function! ale_linters#verilog#iverilog#Handle(buffer, lines) abort
|
|||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': 1,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -39,7 +39,6 @@ function! ale_linters#verilog#verilator#Handle(buffer, lines) abort
|
|||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': 1,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
|
|
@ -7,7 +7,7 @@ let g:ale_vim_vint_show_style_issues =
|
|||
|
||||
let s:warning_flag = g:ale_vim_vint_show_style_issues ? '-s' : '-w'
|
||||
let s:vint_version = ale#semver#Parse(system('vint --version'))
|
||||
let s:has_no_color_support = ale#semver#GreaterOrEqual(s:vint_version, [3, 0, 7])
|
||||
let s:has_no_color_support = ale#semver#GreaterOrEqual(s:vint_version, [0, 3, 7])
|
||||
let s:enable_neovim = has('nvim') ? ' --enable-neovim ' : ''
|
||||
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ function! ale_linters#yaml#yamllint#Handle(buffer, lines) abort
|
|||
let l:type = l:match[3]
|
||||
let l:text = l:match[4]
|
||||
|
||||
" vcol is Needed to indicate that the column is a character.
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:line,
|
||||
|
|
|
@ -11,6 +11,7 @@ function! ale#ShouldDoNothing() abort
|
|||
" Do nothing for blacklisted files
|
||||
" OR if ALE is running in the sandbox
|
||||
return index(g:ale_filetype_blacklist, &filetype) >= 0
|
||||
\ || (exists('*getcmdwintype') && !empty(getcmdwintype()))
|
||||
\ || ale#util#InSandbox()
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ function! ale#cleanup#Buffer(buffer) abort
|
|||
" Clear delayed highlights for a buffer being removed.
|
||||
if g:ale_set_highlights
|
||||
call ale#highlight#UnqueueHighlights(a:buffer)
|
||||
call ale#highlight#RemoveHighlights([])
|
||||
endif
|
||||
|
||||
call remove(g:ale_buffer_info, a:buffer)
|
||||
|
|
|
@ -46,18 +46,25 @@ function! s:GetCurrentMatchIDs(loclist) abort
|
|||
return l:current_id_map
|
||||
endfunction
|
||||
|
||||
function! ale#highlight#UpdateHighlights() abort
|
||||
let l:buffer = bufnr('%')
|
||||
let l:has_new_items = has_key(s:buffer_highlights, l:buffer)
|
||||
let l:loclist = l:has_new_items ? remove(s:buffer_highlights, l:buffer) : []
|
||||
let l:current_id_map = s:GetCurrentMatchIDs(l:loclist)
|
||||
" Given a loclist for current items to highlight, remove all highlights
|
||||
" except these which have matching loclist item entries.
|
||||
function! ale#highlight#RemoveHighlights(loclist) abort
|
||||
let l:current_id_map = s:GetCurrentMatchIDs(a:loclist)
|
||||
|
||||
if l:has_new_items || !g:ale_enabled
|
||||
for l:match in s:GetALEMatches()
|
||||
if !has_key(l:current_id_map, l:match.id)
|
||||
call matchdelete(l:match.id)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! ale#highlight#UpdateHighlights() abort
|
||||
let l:buffer = bufnr('%')
|
||||
let l:has_new_items = has_key(s:buffer_highlights, l:buffer)
|
||||
let l:loclist = l:has_new_items ? remove(s:buffer_highlights, l:buffer) : []
|
||||
|
||||
if l:has_new_items || !g:ale_enabled
|
||||
call ale#highlight#RemoveHighlights(l:loclist)
|
||||
endif
|
||||
|
||||
" Remove anything with a current match_id
|
||||
|
|
|
@ -6,7 +6,6 @@ Execute(The coffeelint handler should parse lines correctly):
|
|||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 125,
|
||||
\ 'col': 1,
|
||||
\ 'text': "Line exceeds maximum allowed length Length is 122, max is 120.",
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
|
|
|
@ -3,6 +3,7 @@ Given (Some invalid lines of PHP):
|
|||
class Foo { / }
|
||||
$foo)
|
||||
['foo' 'bar']
|
||||
function count() {}
|
||||
|
||||
Execute(The php handler should parse lines correctly):
|
||||
runtime ale_linters/php/php.vim
|
||||
|
@ -39,6 +40,13 @@ Execute(The php handler should parse lines correctly):
|
|||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 5,
|
||||
\ 'col': 0,
|
||||
\ 'text': "Cannot redeclare count()",
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 21,
|
||||
\ 'col': 0,
|
||||
\ 'text': "syntax error, unexpected end of file",
|
||||
|
@ -54,10 +62,12 @@ Execute(The php handler should parse lines correctly):
|
|||
\ ],
|
||||
\ ale_linters#php#php#Handle(347, [
|
||||
\ 'This line should be ignored completely',
|
||||
\ "Parse error: syntax error, This line should be ignored completely in - on line 1",
|
||||
\ "PHP Parse error: syntax error, unexpected ';', expecting ']' in - on line 1",
|
||||
\ "PHP Parse error: syntax error, unexpected '/', expecting function (T_FUNCTION) or const (T_CONST) in - on line 2",
|
||||
\ "PHP Parse error: syntax error, unexpected ')' in - on line 3",
|
||||
\ "PHP Parse error: syntax error, unexpected ''bar'' (T_CONSTANT_ENCAPSED_STRING), expecting ']' in - on line 4",
|
||||
\ "PHP Fatal error: Cannot redeclare count() in - on line 5",
|
||||
\ 'PHP Parse error: syntax error, unexpected end of file in - on line 21',
|
||||
\ 'PHP Parse error: Invalid numeric literal in - on line 47',
|
||||
\ ])
|
||||
|
|
53
test/handler/test_shell_handler.vader
Normal file
53
test/handler/test_shell_handler.vader
Normal file
|
@ -0,0 +1,53 @@
|
|||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The shell handler should parse lines correctly):
|
||||
runtime ale_linters/sh/shell.vim
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 13,
|
||||
\ 'text': 'syntax error near unexpected token d',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 7,
|
||||
\ 'text': 'line 42: line 36:',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 11,
|
||||
\ 'text': 'Syntax error: "(" unexpected',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 95,
|
||||
\ 'text': 'parse error near `out=$(( $1 / 1024. )...',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 22,
|
||||
\ 'text': ':11: :33: :44:',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 9,
|
||||
\ 'text': '`done'' unexpected',
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#sh#shell#Handle(347, [
|
||||
\ 'bash: line 13: syntax error near unexpected token d',
|
||||
\ 'bash: line 7: line 42: line 36:',
|
||||
\ 'sh: 11: Syntax error: "(" unexpected',
|
||||
\ 'qfm:95: parse error near `out=$(( $1 / 1024. )...',
|
||||
\ 'qfm:22: :11: :33: :44:',
|
||||
\ 'foo.sh: syntax error at line 9: `done'' unexpected',
|
||||
\ ])
|
|
@ -74,3 +74,20 @@ Execute(Existing highlights should be kept):
|
|||
\ {'group': 'ALEWarning', 'id': 8, 'priority': 10, 'pos1': [4, 1, 1]},
|
||||
\ ],
|
||||
\ getmatches()
|
||||
|
||||
" This test is important for preventing ALE from showing highlights for
|
||||
" the wrong files.
|
||||
Execute(Highlights set by ALE should be removed when buffer cleanup is done):
|
||||
call ale#engine#InitBufferInfo(bufnr('%'))
|
||||
|
||||
call ale#highlight#SetHighlights(bufnr('%'), [
|
||||
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
|
||||
\])
|
||||
|
||||
AssertEqual
|
||||
\ [{'group': 'ALEError', 'id': 9, 'priority': 10, 'pos1': [3, 2, 1]}],
|
||||
\ getmatches()
|
||||
|
||||
call ale#cleanup#Buffer(bufnr('%'))
|
||||
|
||||
AssertEqual [], getmatches()
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
Before:
|
||||
" Temporarily set the shell to /bin/sh, if it isn't already set that way.
|
||||
" This will make it so the test works when running it directly.
|
||||
let g:current_shell = &shell
|
||||
let &shell = '/bin/sh'
|
||||
let g:history = []
|
||||
let g:ale_buffer_info = {}
|
||||
let g:ale_max_buffer_history_size = 20
|
||||
|
@ -16,6 +20,9 @@ Before:
|
|||
\})
|
||||
|
||||
After:
|
||||
" Reset the shell back to what it was before.
|
||||
let &shell = g:current_shell
|
||||
unlet g:current_shell
|
||||
let g:ale_history_enabled = 1
|
||||
let g:ale_history_log_output = 0
|
||||
unlet g:history
|
||||
|
@ -37,7 +44,7 @@ Execute(History should be set when commands are run):
|
|||
|
||||
AssertEqual 1, len(g:history)
|
||||
AssertEqual sort(['status', 'exit_code', 'job_id', 'command']), sort(keys(g:history[0]))
|
||||
AssertEqual ['/bin/bash', '-c', 'echo command history test'], g:history[0].command
|
||||
AssertEqual ['/bin/sh', '-c', 'echo command history test'], g:history[0].command
|
||||
AssertEqual 'finished', g:history[0].status
|
||||
AssertEqual 0, g:history[0].exit_code
|
||||
" The Job ID will change each time, but we can check the type.
|
||||
|
|
|
@ -7,6 +7,8 @@ set runtimepath=/home/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,/testplu
|
|||
" The following is just an example
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
set shell=/bin/sh
|
||||
set shellcmdflag=-c
|
||||
set nocompatible
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
|
|
Reference in a new issue