Ban use of ==# or ==? in the codebase, and prefer is# or is? instead

This commit is contained in:
w0rp 2017-08-08 08:39:13 +01:00
parent 5010ddc28f
commit a535d07f28
61 changed files with 158 additions and 154 deletions

View file

@ -46,7 +46,7 @@ function! s:GetJSONLines(lines) abort
let l:start_index = 0
for l:line in a:lines
if l:line[:0] ==# '{'
if l:line[:0] is# '{'
break
endif
@ -77,13 +77,13 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
" In certain cases, `l:message.loc.source` points to a different path
" than the buffer one, thus we skip this loc information too.
if has_key(l:message, 'loc')
\&& l:line ==# 0
\&& l:line is# 0
\&& ale#path#IsBufferPath(a:buffer, l:message.loc.source)
let l:line = l:message.loc.start.line + 0
let l:col = l:message.loc.start.column + 0
endif
if l:text ==# ''
if l:text is# ''
let l:text = l:message.descr . ':'
else
let l:text = l:text . ' ' . l:message.descr
@ -98,7 +98,7 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
\ 'lnum': l:line,
\ 'col': l:col,
\ 'text': l:text,
\ 'type': l:error.level ==# 'error' ? 'E' : 'W',
\ 'type': l:error.level is# 'error' ? 'E' : 'W',
\})
endfor