Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit dac07db

Browse files
committed
Cleanup: shut up most vint warnings.
1 parent ac96ae4 commit dac07db

163 files changed

Lines changed: 379 additions & 379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

autoload/syntastic/c.vim

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists("g:loaded_syntastic_c_autoload") || !exists("g:loaded_syntastic_plugin")
1+
if exists('g:loaded_syntastic_c_autoload') || !exists('g:loaded_syntastic_plugin')
22
finish
33
endif
44
let g:loaded_syntastic_c_autoload = 1
@@ -22,7 +22,7 @@ function! syntastic#c#ReadConfig(file) abort " {{{2
2222

2323
" search upwards from the current file's directory
2424
let config = findfile(a:file, '.;')
25-
if config == ''
25+
if config ==# ''
2626
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: file not found')
2727
return ''
2828
endif
@@ -44,7 +44,7 @@ function! syntastic#c#ReadConfig(file) abort " {{{2
4444
endtry
4545

4646
" filter out empty lines and comments
47-
call filter(lines, 'v:val !~ ''\v^(\s*#|$)''')
47+
call filter(lines, 'v:val !~# ''\v^(\s*#|$)''')
4848

4949
" remove leading and trailing spaces
5050
call map(lines, 'substitute(v:val, ''\m^\s\+'', "", "")')
@@ -53,7 +53,7 @@ function! syntastic#c#ReadConfig(file) abort " {{{2
5353
let parameters = []
5454
for line in lines
5555
let matches = matchstr(line, '\m\C^\s*-I\s*\zs.\+')
56-
if matches != ''
56+
if matches !=# ''
5757
" this one looks like an absolute path
5858
if match(matches, '\m^\%(/\|\a:\)') != -1
5959
call add(parameters, '-I' . matches)
@@ -120,9 +120,9 @@ endfunction " }}}2
120120
" register a handler dictionary object
121121
function! s:_registerHandler(regex, function, args) abort " {{{2
122122
let handler = {}
123-
let handler["regex"] = a:regex
124-
let handler["func"] = function(a:function)
125-
let handler["args"] = a:args
123+
let handler['regex'] = a:regex
124+
let handler['func'] = function(a:function)
125+
let handler['args'] = a:args
126126
call add(s:handlers, handler)
127127
endfunction " }}}2
128128

@@ -223,7 +223,7 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2
223223

224224
" check if the user manually set some cflags
225225
let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '')
226-
if b_cflags == ''
226+
if b_cflags ==# ''
227227
" check whether to search for include files at all
228228
if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0)
229229
if a:ft ==# 'c' || a:ft ==# 'cpp'
@@ -280,23 +280,23 @@ function! s:_search_headers() abort " {{{2
280280
" search current buffer
281281
for line in lines
282282
let file = matchstr(line, '\m"\zs\S\+\ze"')
283-
if file != ''
283+
if file !=# ''
284284
call add(files, file)
285285
continue
286286
endif
287287

288288
for handler in s:handlers
289-
if line =~# handler["regex"]
290-
let includes .= call(handler["func"], handler["args"])
291-
call add(found, handler["regex"])
289+
if line =~# handler['regex']
290+
let includes .= call(handler['func'], handler['args'])
291+
call add(found, handler['regex'])
292292
break
293293
endif
294294
endfor
295295
endfor
296296

297297
" search included headers
298298
for hfile in files
299-
if hfile != ''
299+
if hfile !=# ''
300300
let filename = expand('%:p:h', 1) . syntastic#util#Slash() . hfile
301301

302302
try
@@ -308,14 +308,14 @@ function! s:_search_headers() abort " {{{2
308308
call filter(lines, 'v:val =~# ''\m^\s*#\s*include''')
309309

310310
for handler in s:handlers
311-
if index(found, handler["regex"]) != -1
311+
if index(found, handler['regex']) != -1
312312
continue
313313
endif
314314

315315
for line in lines
316-
if line =~# handler["regex"]
317-
let includes .= call(handler["func"], handler["args"])
318-
call add(found, handler["regex"])
316+
if line =~# handler['regex']
317+
let includes .= call(handler['func'], handler['args'])
318+
call add(found, handler['regex'])
319319
break
320320
endif
321321
endfor

autoload/syntastic/log.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists("g:loaded_syntastic_log_autoload") || !exists("g:loaded_syntastic_plugin")
1+
if exists('g:loaded_syntastic_log_autoload') || !exists('g:loaded_syntastic_plugin')
22
finish
33
endif
44
let g:loaded_syntastic_log_autoload = 1
@@ -11,19 +11,19 @@ let s:one_time_notices_issued = []
1111
" Public functions {{{1
1212

1313
function! syntastic#log#info(msg) abort " {{{2
14-
echomsg "syntastic: info: " . a:msg
14+
echomsg 'syntastic: info: ' . a:msg
1515
endfunction " }}}2
1616

1717
function! syntastic#log#warn(msg) abort " {{{2
1818
echohl WarningMsg
19-
echomsg "syntastic: warning: " . a:msg
19+
echomsg 'syntastic: warning: ' . a:msg
2020
echohl None
2121
endfunction " }}}2
2222

2323
function! syntastic#log#error(msg) abort " {{{2
2424
execute "normal \<Esc>"
2525
echohl ErrorMsg
26-
echomsg "syntastic: error: " . a:msg
26+
echomsg 'syntastic: error: ' . a:msg
2727
echohl None
2828
endfunction " }}}2
2929

@@ -88,7 +88,7 @@ function! syntastic#log#debugShowOptions(level, names) abort " {{{2
8888
let leader = s:_log_timestamp()
8989
call s:_logRedirect(1)
9090

91-
let vlist = copy(type(a:names) == type("") ? [a:names] : a:names)
91+
let vlist = copy(type(a:names) == type('') ? [a:names] : a:names)
9292
if !empty(vlist)
9393
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
9494
echomsg leader . join(vlist, ', ')
@@ -104,10 +104,10 @@ function! syntastic#log#debugShowVariables(level, names) abort " {{{2
104104
let leader = s:_log_timestamp()
105105
call s:_logRedirect(1)
106106

107-
let vlist = type(a:names) == type("") ? [a:names] : a:names
107+
let vlist = type(a:names) == type('') ? [a:names] : a:names
108108
for name in vlist
109109
let msg = s:_format_variable(name)
110-
if msg != ''
110+
if msg !=# ''
111111
echomsg leader . msg
112112
endif
113113
endfor
@@ -140,7 +140,7 @@ let s:_isDebugEnabled = function(exists('*and') ? 's:_isDebugEnabled_smart' : 's
140140
lockvar s:_isDebugEnabled
141141

142142
function! s:_logRedirect(on) abort " {{{2
143-
if exists("g:syntastic_debug_file")
143+
if exists('g:syntastic_debug_file')
144144
if a:on
145145
try
146146
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file, 1))

autoload/syntastic/postprocess.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists("g:loaded_syntastic_postprocess_autoload") || !exists("g:loaded_syntastic_plugin")
1+
if exists('g:loaded_syntastic_postprocess_autoload') || !exists('g:loaded_syntastic_plugin')
22
finish
33
endif
44
let g:loaded_syntastic_postprocess_autoload = 1

autoload/syntastic/preprocess.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists("g:loaded_syntastic_preprocess_autoload") || !exists("g:loaded_syntastic_plugin")
1+
if exists('g:loaded_syntastic_preprocess_autoload') || !exists('g:loaded_syntastic_plugin')
22
finish
33
endif
44
let g:loaded_syntastic_preprocess_autoload = 1
@@ -13,14 +13,14 @@ function! syntastic#preprocess#cabal(errors) abort " {{{2
1313
let star = 0
1414
for err in a:errors
1515
if star
16-
if err == ''
16+
if err ==# ''
1717
let star = 0
1818
else
1919
let out[-1] .= ' ' . err
2020
endif
2121
else
2222
call add(out, err)
23-
if err =~ '\m^*\s'
23+
if err =~# '\m^*\s'
2424
let star = 1
2525
endif
2626
endif
@@ -124,7 +124,7 @@ endfunction " }}}2
124124
" @vimlint(EVL102, 0, l:null)
125125

126126
function! syntastic#preprocess#killEmpty(errors) abort " {{{2
127-
return filter(copy(a:errors), 'v:val != ""')
127+
return filter(copy(a:errors), 'v:val !=# ""')
128128
endfunction " }}}2
129129

130130
function! syntastic#preprocess#perl(errors) abort " {{{2
@@ -204,7 +204,7 @@ function! syntastic#preprocess#rparse(errors) abort " {{{2
204204
" remove uninteresting lines and handle continuations
205205
let i = 0
206206
while i < len(errlist)
207-
if i > 0 && errlist[i][:1] == ' ' && errlist[i] !~ '\m\s\+\^$'
207+
if i > 0 && errlist[i][:1] ==# ' ' && errlist[i] !~# '\m\s\+\^$'
208208
let errlist[i-1] .= errlist[i][1:]
209209
call remove(errlist, i)
210210
elseif errlist[i] !~# '\m^\(Lint:\|Lint checking:\|Error in\) '
@@ -224,7 +224,7 @@ function! syntastic#preprocess#rparse(errors) abort " {{{2
224224
call add(out, 'E:' . fname . ':' . line . ': ' . parts[1])
225225
endfor
226226
endif
227-
if len(parts) >= 5 && parts[4] != ''
227+
if len(parts) >= 5 && parts[4] !=# ''
228228
call add(out, 'E:' . fname . ':0: ' . parts[1] . ' - ' . parts[4] . ' messages not shown')
229229
endif
230230
elseif match(e, '\m^Lint checking: ') == 0

autoload/syntastic/util.vim

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists('g:loaded_syntastic_util_autoload') || !exists("g:loaded_syntastic_plugin")
1+
if exists('g:loaded_syntastic_util_autoload') || !exists('g:loaded_syntastic_plugin')
22
finish
33
endif
44
let g:loaded_syntastic_util_autoload = 1
@@ -21,7 +21,7 @@ endfunction " }}}2
2121

2222
" Get directory separator
2323
function! syntastic#util#Slash() abort " {{{2
24-
return (!exists("+shellslash") || &shellslash) ? '/' : '\'
24+
return (!exists('+shellslash') || &shellslash) ? '/' : '\'
2525
endfunction " }}}2
2626

2727
function! syntastic#util#CygwinPath(path) abort " {{{2
@@ -53,19 +53,19 @@ function! syntastic#util#tmpdir() abort " {{{2
5353

5454
if (has('unix') || has('mac')) && executable('mktemp')
5555
" TODO: option "-t" to mktemp(1) is not portable
56-
let tmp = $TMPDIR != '' ? $TMPDIR : $TMP != '' ? $TMP : '/tmp'
56+
let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
5757
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
5858
if v:shell_error == 0 && len(out) == 1
5959
let tempdir = out[0]
6060
endif
6161
endif
6262

63-
if tempdir == ''
63+
if tempdir ==# ''
6464
if has('win32') || has('win64')
6565
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid()
6666
elseif has('win32unix')
6767
let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . getpid())
68-
elseif $TMPDIR != ''
68+
elseif $TMPDIR !=# ''
6969
let tempdir = $TMPDIR . '/vim-syntastic-' . getpid()
7070
else
7171
let tempdir = '/tmp/vim-syntastic-' . getpid()
@@ -97,7 +97,7 @@ function! syntastic#util#rmrf(what) abort " {{{2
9797
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
9898
endif
9999

100-
if s:rmrf != ''
100+
if s:rmrf !=# ''
101101
silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
102102
else
103103
call s:_rmrf(a:what)
@@ -120,7 +120,7 @@ endfunction " }}}2
120120
function! syntastic#util#parseShebang() abort " {{{2
121121
for lnum in range(1, 5)
122122
let line = getline(lnum)
123-
if line =~ '^#!'
123+
if line =~# '^#!'
124124
let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '')
125125
let exe = matchstr(line, '\m^\S*\ze')
126126
let args = split(matchstr(line, '\m^\S*\zs.*'))
@@ -190,7 +190,7 @@ function! syntastic#util#wideMsg(msg) abort " {{{2
190190

191191
"This is here because it is possible for some error messages to
192192
"begin with \n which will cause a "press enter" prompt.
193-
let msg = substitute(a:msg, "\n", "", "g")
193+
let msg = substitute(a:msg, "\n", '', 'g')
194194

195195
"convert tabs to spaces so that the tabs count towards the window
196196
"width as the proper amount of characters
@@ -232,15 +232,15 @@ function! syntastic#util#findInParent(what, where) abort " {{{2
232232
let here = fnamemodify(a:where, ':p')
233233

234234
let root = syntastic#util#Slash()
235-
if syntastic#util#isRunningWindows() && here[1] == ':'
235+
if syntastic#util#isRunningWindows() && here[1] ==# ':'
236236
" The drive letter is an ever-green source of fun. That's because
237237
" we don't care about running syntastic on Amiga these days. ;)
238238
let root = fnamemodify(root, ':p')
239239
let root = here[0] . root[1:]
240240
endif
241241

242242
let old = ''
243-
while here != ''
243+
while here !=# ''
244244
let p = split(globpath(here, a:what, 1), '\n')
245245

246246
if !empty(p)
@@ -284,7 +284,7 @@ endfunction " }}}2
284284

285285
" Escape arguments
286286
function! syntastic#util#argsescape(opt) abort " {{{2
287-
if type(a:opt) == type('') && a:opt != ''
287+
if type(a:opt) == type('') && a:opt !=# ''
288288
return [a:opt]
289289
elseif type(a:opt) == type([])
290290
return map(copy(a:opt), 'syntastic#util#shescape(v:val)')
@@ -345,14 +345,14 @@ function! s:_translateFilter(filters) abort " {{{2
345345
endfor
346346

347347
if conditions == []
348-
let conditions = ["1"]
348+
let conditions = ['1']
349349
endif
350350
return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
351351
endfunction " }}}2
352352

353353
function! s:_translateElement(key, term) abort " {{{2
354354
let fkey = a:key
355-
if fkey[0] == '!'
355+
if fkey[0] ==# '!'
356356
let fkey = fkey[1:]
357357
let not = 1
358358
else
@@ -377,13 +377,13 @@ function! s:_translateElement(key, term) abort " {{{2
377377
let op = not ? ' =~# ' : ' !~# '
378378
let ret = 'bufname(str2nr(v:val["bufnr"]))'
379379
let mod = fkey[4:]
380-
if mod != ''
380+
if mod !=# ''
381381
let ret = 'fnamemodify(' . ret . ', ' . string(mod) . ')'
382382
endif
383383
let ret .= op . string(a:term)
384384
else
385385
call syntastic#log#warn('quiet_messages: ignoring invalid key ' . strtrans(string(fkey)))
386-
let ret = "1"
386+
let ret = '1'
387387
endif
388388
return ret
389389
endfunction " }}}2

0 commit comments

Comments
 (0)