Ban !=# and !=? from the codebase

This commit is contained in:
w0rp
2017-08-11 00:31:42 +01:00
parent b1462ac66c
commit d5ae3201a4
24 changed files with 37 additions and 33 deletions

View File

@@ -58,7 +58,7 @@ function! ale#Queue(delay, ...) abort
endfunction
function! s:ALEQueueImpl(delay, linting_flag, buffer) abort
if a:linting_flag !=# '' && a:linting_flag !=# 'lint_file'
if a:linting_flag isnot# '' && a:linting_flag isnot# 'lint_file'
throw "linting_flag must be either '' or 'lint_file'"
endif

View File

@@ -72,7 +72,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
endif
" Only echo the warnings in normal mode, otherwise we will get problems.
if mode() !=# 'n'
if mode() isnot# 'n'
return
endif
@@ -118,7 +118,7 @@ function! ale#cursor#ShowCursorDetail() abort
endif
" Only echo the warnings in normal mode, otherwise we will get problems.
if mode() !=# 'n'
if mode() isnot# 'n'
return
endif

View File

@@ -128,14 +128,14 @@ function! s:HandleLoclist(linter_name, buffer, loclist) abort
" Remove this linter from the list of active linters.
" This may have already been done when the job exits.
call filter(l:buffer_info.active_linter_list, 'v:val !=# a:linter_name')
call filter(l:buffer_info.active_linter_list, 'v:val isnot# a:linter_name')
" Make some adjustments to the loclists to fix common problems, and also
" to set default values for loclist items.
let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist)
" Remove previous items for this linter.
call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name !=# a:linter_name')
call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name isnot# a:linter_name')
" Add the new items.
call extend(g:ale_buffer_info[a:buffer].loclist, l:linter_loclist)
@@ -169,8 +169,8 @@ function! s:HandleExit(job_id, exit_code) abort
" Remove this job from the list.
call ale#job#Stop(a:job_id)
call remove(s:job_info_map, a:job_id)
call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val !=# a:job_id')
call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val !=# l:linter.name')
call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id')
call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val isnot# l:linter.name')
" Stop here if we land in the handle for a job completing if we're in
" a sandbox.

View File

@@ -335,7 +335,7 @@ function! ale#fix#Fix(...) abort
let l:fixing_flag = get(a:000, 0, '')
if l:fixing_flag !=# '' && l:fixing_flag !=# 'save_file'
if l:fixing_flag isnot# '' && l:fixing_flag isnot# 'save_file'
throw "fixing_flag must be either '' or 'save_file'"
endif

View File

@@ -161,7 +161,7 @@ function! ale#job#ParseVim8ProcessID(job_string) abort
endfunction
function! ale#job#ValidateArguments(command, options) abort
if a:options.mode !=# 'nl' && a:options.mode !=# 'raw'
if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw'
throw 'Invalid mode: ' . a:options.mode
endif
endfunction

View File

@@ -60,8 +60,8 @@ function! ale#linter#PreProcess(linter) abort
endif
let l:needs_address = l:obj.lsp is# 'socket'
let l:needs_executable = l:obj.lsp !=# 'socket'
let l:needs_command = l:obj.lsp !=# 'socket'
let l:needs_executable = l:obj.lsp isnot# 'socket'
let l:needs_command = l:obj.lsp isnot# 'socket'
let l:needs_lsp_details = !empty(l:obj.lsp)
if empty(l:obj.lsp)
@@ -377,7 +377,7 @@ function! ale#linter#StartLSP(buffer, linter, callback) abort
let l:address = ''
let l:root = ale#util#GetFunction(a:linter.project_root_callback)(a:buffer)
if empty(l:root) && a:linter.lsp !=# 'tsserver'
if empty(l:root) && a:linter.lsp isnot# 'tsserver'
" If there's no project root, then we can't check files with LSP,
" unless we are using tsserver, which doesn't use project roots.
return {}

View File

@@ -62,7 +62,7 @@ function! ale#list#SetLists(buffer, loclist) abort
endif
" If focus changed, restore it (jump to the last window).
if l:winnr !=# winnr()
if l:winnr isnot# winnr()
wincmd p
endif

View File

@@ -296,7 +296,7 @@ function! ale#lsp#ConnectToAddress(address, project_root, callback) abort
" Get the current connection or a new one.
let l:conn = !empty(l:conn) ? l:conn : s:NewConnection()
if !has_key(l:conn, 'channel') || ch_status(l:conn.channel) !=# 'open'
if !has_key(l:conn, 'channel') || ch_status(l:conn.channel) isnot# 'open'
let l:conn.channnel = ch_open(a:address, {
\ 'mode': 'raw',
\ 'waittime': 0,

View File

@@ -10,7 +10,7 @@ function! ale#ruby#FindRailsRoot(buffer) abort
\ ':h:h'
\)
if l:dir !=# '.'
if l:dir isnot# '.'
\&& isdirectory(l:dir . '/app')
\&& isdirectory(l:dir . '/config')
\&& isdirectory(l:dir . '/db')

View File

@@ -40,7 +40,7 @@ if !hlexists('ALESignColumnWithoutErrors')
if !empty(l:match)
execute 'highlight link ALESignColumnWithoutErrors ' . l:match[1]
elseif l:highlight_syntax !=# 'cleared'
elseif l:highlight_syntax isnot# 'cleared'
execute 'highlight ALESignColumnWithoutErrors ' . l:highlight_syntax
endif
endfunction

View File

@@ -12,7 +12,7 @@
"
" This function should be run in a Vader Before: block.
function! ale#test#SetDirectory(docker_path) abort
if a:docker_path[:len('/testplugin/') - 1] !=# '/testplugin/'
if a:docker_path[:len('/testplugin/') - 1] isnot# '/testplugin/'
throw 'docker_path must start with /testplugin/!'
endif

View File

@@ -136,7 +136,7 @@ function! s:LoadArgCount(function) abort
endif
let l:match = matchstr(split(l:output, "\n")[0], '\v\([^)]+\)')[1:-2]
let l:arg_list = filter(split(l:match, ', '), 'v:val !=# ''...''')
let l:arg_list = filter(split(l:match, ', '), 'v:val isnot# ''...''')
return len(l:arg_list)
endfunction