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
+1 -1
View File
@@ -11,7 +11,7 @@ function! ale#handlers#cppcheck#HandleCppCheckFormat(buffer, lines) abort
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[3] ==# 'error' ? 'E' : 'W',
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
\ 'text': l:match[4],
\})
endif
+2 -2
View File
@@ -29,7 +29,7 @@ function! ale#handlers#css#HandleCSSLintFormat(buffer, lines) abort
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:text,
\ 'type': l:type ==# 'Warning' ? 'W' : 'E',
\ 'type': l:type is# 'Warning' ? 'W' : 'E',
\})
endfor
@@ -61,7 +61,7 @@ function! ale#handlers#css#HandleStyleLintFormat(buffer, lines) abort
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:match[3] ==# '✖' ? 'E' : 'W',
\ 'type': l:match[3] is# '✖' ? 'E' : 'W',
\ 'text': l:match[4] . ' [' . l:match[5] . ']',
\})
endfor
+1 -1
View File
@@ -92,7 +92,7 @@ function! ale#handlers#eslint#Handle(buffer, lines) abort
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:text,
\ 'type': l:type ==# 'Warning' ? 'W' : 'E',
\ 'type': l:type is# 'Warning' ? 'W' : 'E',
\}
for l:col_match in ale#util#GetMatches(l:text, s:col_end_patterns)
+2 -2
View File
@@ -81,7 +81,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:included_filename = ''
endif
elseif l:include_lnum > 0
\&& (empty(l:included_filename) || l:included_filename ==# l:match[1])
\&& (empty(l:included_filename) || l:included_filename is# l:match[1])
" If we hit the first error after an include header, or the
" errors below have the same name as the first filename we see,
" then include these lines, and remember what that filename was.
@@ -96,7 +96,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:included_filename = ''
if s:IsHeaderFile(bufname(bufnr('')))
\&& l:match[5][:len(s:pragma_error) - 1] ==# s:pragma_error
\&& l:match[5][:len(s:pragma_error) - 1] is# s:pragma_error
continue
endif
+3 -3
View File
@@ -14,7 +14,7 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
for l:line in a:lines
if len(matchlist(l:line, l:pattern)) > 0
call add(l:corrected_lines, l:line)
elseif l:line ==# ''
elseif l:line is# ''
call add(l:corrected_lines, l:line)
else
if len(l:corrected_lines) > 0
@@ -42,10 +42,10 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
let l:text = l:errors[2]
else
let l:ghc_type = ''
let l:text = l:match[4][:0] ==# ' ' ? l:match[4][1:] : l:match[4]
let l:text = l:match[4][:0] is# ' ' ? l:match[4][1:] : l:match[4]
endif
if l:ghc_type ==? 'Warning'
if l:ghc_type is? 'Warning'
let l:type = 'W'
else
let l:type = 'E'
+1 -1
View File
@@ -47,7 +47,7 @@ function! ale#handlers#rust#HandleRustErrorsForFile(buffer, full_filename, lines
for l:span in l:error.spans
if (
\ l:span.is_primary
\ && (ale#path#IsBufferPath(a:buffer, l:span.file_name) || l:span.file_name ==# '<anon>')
\ && (ale#path#IsBufferPath(a:buffer, l:span.file_name) || l:span.file_name is# '<anon>')
\)
call add(l:output, {
\ 'lnum': l:span.line_start,