Remove 'col' from linters where it is hardcoded to 1 (#434)

* Remove 'col' from linters where it is hardcoded to 1

When 'col' is 1, the first column will get highlighted for no reason. It
should be 0 (which is the default).

In the scalac linter there was also a check about the outcome of
`stridx`. It would set l:col to 0 if it was -1, and then it uses
`'col': l:col + 1` to convert the outcome of `stridx` to the actual
column number. This will make 'col' equals 1 when there is no match. We
can remove the check because `-1 + 1 = 0`.

* Remove outdated comments about vcol

vcol was added as a default, and the loclists that follow these comments
do not contain 'vcol' anymore

Conflicts:
	ale_linters/elixir/dogma.vim
This commit is contained in:
Adriaan Zonnenberg 2017-03-31 00:33:38 +02:00 committed by w0rp
parent 964d3ab9ec
commit 1f7679e619
31 changed files with 0 additions and 43 deletions

View File

@ -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,

View File

@ -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,
\})

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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',
\})

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,
\})

View File

@ -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,
\})

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -49,15 +49,12 @@ function! ale_linters#sh#shell#Handle(buffer, lines) abort
endif
let l:line = l:match[1] + 0
let l:column = 1
let l:text = l:match[2]
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,
\})

View File

@ -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',
\})

View File

@ -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,

View File

@ -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,

View File

@ -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,
\})

View File

@ -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,
\})

View File

@ -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,

View File

@ -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',
\ },