Cleanup: shut up lint warnings, formatting, doc nit.
This commit is contained in:
parent
49f99259d6
commit
f3240e6001
@ -230,6 +230,7 @@ function! s:translateFilter(filters)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:translateElement(key, term)
|
function! s:translateElement(key, term)
|
||||||
|
let ret = "1"
|
||||||
if a:key ==? 'level'
|
if a:key ==? 'level'
|
||||||
let ret = 'v:val["type"] !=? ' . string(a:term[0])
|
let ret = 'v:val["type"] !=? ' . string(a:term[0])
|
||||||
elseif a:key ==? 'type'
|
elseif a:key ==? 'type'
|
||||||
|
@ -612,7 +612,7 @@ can't be used together with syntastic. You don't need to change your login
|
|||||||
shell to address this problem, but you do have to point Vim's 'shell' to a more
|
shell to address this problem, but you do have to point Vim's 'shell' to a more
|
||||||
traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
|
traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
|
||||||
'sh': >
|
'sh': >
|
||||||
set shell = 'bash'
|
set shell=bash
|
||||||
<
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
@ -23,9 +23,9 @@ runtime! plugin/syntastic/*.vim
|
|||||||
|
|
||||||
let s:running_windows = syntastic#util#isRunningWindows()
|
let s:running_windows = syntastic#util#isRunningWindows()
|
||||||
|
|
||||||
for feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
|
for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
|
||||||
if !has(feature)
|
if !has(s:feature)
|
||||||
call syntastic#log#error("need Vim compiled with feature " . feature)
|
call syntastic#log#error("need Vim compiled with feature " . s:feature)
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@ -96,12 +96,12 @@ endif
|
|||||||
if exists("g:syntastic_quiet_warnings")
|
if exists("g:syntastic_quiet_warnings")
|
||||||
call syntastic#log#deprecationWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
|
call syntastic#log#deprecationWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
|
||||||
if g:syntastic_quiet_warnings
|
if g:syntastic_quiet_warnings
|
||||||
let quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
|
let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
|
||||||
if type(quiet_warnings) != type([])
|
if type(s:quiet_warnings) != type([])
|
||||||
let quiet_warnings = [quiet_warnings]
|
let s:quiet_warnings = [s:quiet_warnings]
|
||||||
endif
|
endif
|
||||||
call add(quiet_warnings, 'warnings')
|
call add(s:quiet_warnings, 'warnings')
|
||||||
let g:syntastic_quiet_messages['type'] = quiet_warnings
|
let g:syntastic_quiet_messages['type'] = s:quiet_warnings
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -118,6 +118,9 @@ let s:notifiers = g:SyntasticNotifiers.Instance()
|
|||||||
let s:modemap = g:SyntasticModeMap.Instance()
|
let s:modemap = g:SyntasticModeMap.Instance()
|
||||||
|
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:cursorPos)
|
||||||
|
" @vimlint(EVL103, 1, a:cmdLine)
|
||||||
|
" @vimlint(EVL103, 1, a:argLead)
|
||||||
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos)
|
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos)
|
||||||
let checker_names = []
|
let checker_names = []
|
||||||
for ft in s:CurrentFiletypes()
|
for ft in s:CurrentFiletypes()
|
||||||
@ -127,10 +130,21 @@ function! s:CompleteCheckerName(argLead, cmdLine, cursorPos)
|
|||||||
endfor
|
endfor
|
||||||
return join(checker_names, "\n")
|
return join(checker_names, "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:cursorPos)
|
||||||
|
" @vimlint(EVL103, 0, a:cmdLine)
|
||||||
|
" @vimlint(EVL103, 0, a:argLead)
|
||||||
|
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:cursorPos)
|
||||||
|
" @vimlint(EVL103, 1, a:cmdLine)
|
||||||
|
" @vimlint(EVL103, 1, a:argLead)
|
||||||
function! s:CompleteFiletypes(argLead, cmdLine, cursorPos)
|
function! s:CompleteFiletypes(argLead, cmdLine, cursorPos)
|
||||||
return join(s:registry.knownFiletypes(), "\n")
|
return join(s:registry.knownFiletypes(), "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:cursorPos)
|
||||||
|
" @vimlint(EVL103, 0, a:cmdLine)
|
||||||
|
" @vimlint(EVL103, 0, a:argLead)
|
||||||
|
|
||||||
|
|
||||||
command! SyntasticToggleMode call s:ToggleMode()
|
command! SyntasticToggleMode call s:ToggleMode()
|
||||||
command! -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck
|
command! -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck
|
||||||
|
@ -47,12 +47,14 @@ function! g:SyntasticBalloonsNotifier.refresh(loclist)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Reset the error balloons
|
" Reset the error balloons
|
||||||
|
" @vimlint(EVL103, 1, a:loclist)
|
||||||
function! g:SyntasticBalloonsNotifier.reset(loclist)
|
function! g:SyntasticBalloonsNotifier.reset(loclist)
|
||||||
if has('balloon_eval')
|
if has('balloon_eval')
|
||||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
|
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
|
||||||
set nobeval
|
set nobeval
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:loclist)
|
||||||
|
|
||||||
" Private functions {{{1
|
" Private functions {{{1
|
||||||
|
|
||||||
|
@ -30,12 +30,14 @@ function! g:SyntasticCursorNotifier.refresh(loclist)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:loclist)
|
||||||
function! g:SyntasticCursorNotifier.reset(loclist)
|
function! g:SyntasticCursorNotifier.reset(loclist)
|
||||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
|
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
|
||||||
autocmd! syntastic CursorMoved
|
autocmd! syntastic CursorMoved
|
||||||
unlet! b:syntastic_messages
|
unlet! b:syntastic_messages
|
||||||
let b:oldLine = -1
|
let b:oldLine = -1
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:loclist)
|
||||||
|
|
||||||
" Private methods {{{1
|
" Private methods {{{1
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ function! g:SyntasticHighlightingNotifier.refresh(loclist)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Remove all error highlights from the window
|
" Remove all error highlights from the window
|
||||||
|
" @vimlint(EVL103, 1, a:loclist)
|
||||||
function! g:SyntasticHighlightingNotifier.reset(loclist)
|
function! g:SyntasticHighlightingNotifier.reset(loclist)
|
||||||
if s:has_highlighting
|
if s:has_highlighting
|
||||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
|
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
|
||||||
@ -72,6 +73,7 @@ function! g:SyntasticHighlightingNotifier.reset(loclist)
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:loclist)
|
||||||
|
|
||||||
" Private methods {{{1
|
" Private methods {{{1
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ function! s:GetProfile()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
return profile
|
return profile
|
||||||
endfunction!
|
endfunction
|
||||||
|
|
||||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
\'filetype': 'glsl',
|
\'filetype': 'glsl',
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
" to the extent permitted by applicable law. You can redistribute
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
" it and/or modify it under the terms of the Do What The Fuck You
|
" it and/or modify it under the terms of the Do What The Fuck You
|
||||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
"============================================================================
|
"============================================================================
|
||||||
|
|
||||||
if exists("g:loaded_syntastic_java_javac_checker")
|
if exists("g:loaded_syntastic_java_javac_checker")
|
||||||
@ -96,7 +96,7 @@ function! s:RemoveDir(dir)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:AddToClasspath(classpath,path)
|
function! s:AddToClasspath(classpath, path)
|
||||||
if a:path == ''
|
if a:path == ''
|
||||||
return a:classpath
|
return a:classpath
|
||||||
endif
|
endif
|
||||||
@ -133,7 +133,7 @@ function! s:SaveClasspath()
|
|||||||
let path = ''
|
let path = ''
|
||||||
let lines = getline(1, line('$'))
|
let lines = getline(1, line('$'))
|
||||||
for l in lines
|
for l in lines
|
||||||
let path = s:AddToClasspath(path,l)
|
let path = s:AddToClasspath(path, l)
|
||||||
endfor
|
endfor
|
||||||
" save classpath to config file
|
" save classpath to config file
|
||||||
if g:syntastic_java_javac_config_file_enabled
|
if g:syntastic_java_javac_config_file_enabled
|
||||||
@ -144,7 +144,7 @@ function! s:SaveClasspath()
|
|||||||
let i = 0
|
let i = 0
|
||||||
while i < len(lines)
|
while i < len(lines)
|
||||||
if match(lines[i], 'g:syntastic_java_javac_classpath') != -1
|
if match(lines[i], 'g:syntastic_java_javac_classpath') != -1
|
||||||
call remove(lines,i)
|
call remove(lines, i)
|
||||||
let i -= 1
|
let i -= 1
|
||||||
endif
|
endif
|
||||||
let i += 1
|
let i += 1
|
||||||
@ -153,9 +153,9 @@ function! s:SaveClasspath()
|
|||||||
let lines = []
|
let lines = []
|
||||||
endif
|
endif
|
||||||
" add new g:syntastic_java_javac_classpath option to config
|
" add new g:syntastic_java_javac_classpath option to config
|
||||||
call add(lines,'let g:syntastic_java_javac_classpath = "'.path.'"')
|
call add(lines, 'let g:syntastic_java_javac_classpath = "'.path.'"')
|
||||||
" save config file lines
|
" save config file lines
|
||||||
call writefile(lines,g:syntastic_java_javac_config_file)
|
call writefile(lines, g:syntastic_java_javac_config_file)
|
||||||
endif
|
endif
|
||||||
" set new classpath
|
" set new classpath
|
||||||
let g:syntastic_java_javac_classpath = path
|
let g:syntastic_java_javac_classpath = path
|
||||||
@ -167,7 +167,7 @@ function! s:EditClasspath()
|
|||||||
let winnr = bufwinnr('^' . command . '$')
|
let winnr = bufwinnr('^' . command . '$')
|
||||||
if winnr < 0
|
if winnr < 0
|
||||||
let path = []
|
let path = []
|
||||||
let pathlines = split(g:syntastic_java_javac_classpath,"\n")
|
let pathlines = split(g:syntastic_java_javac_classpath, "\n")
|
||||||
for p in pathlines
|
for p in pathlines
|
||||||
let path += s:SplitClasspath(p)
|
let path += s:SplitClasspath(p)
|
||||||
endfor
|
endfor
|
||||||
@ -192,7 +192,7 @@ function! s:SaveConfig()
|
|||||||
let lines = getline(1, line('$'))
|
let lines = getline(1, line('$'))
|
||||||
if g:syntastic_java_javac_config_file_enabled
|
if g:syntastic_java_javac_config_file_enabled
|
||||||
" save config file lines
|
" save config file lines
|
||||||
call writefile(lines,g:syntastic_java_javac_config_file)
|
call writefile(lines, g:syntastic_java_javac_config_file)
|
||||||
endif
|
endif
|
||||||
let &modified = 0
|
let &modified = 0
|
||||||
endfunction
|
endfunction
|
||||||
@ -275,7 +275,7 @@ function! s:GetMavenClasspath()
|
|||||||
let mvn_classpath = s:RemoveCarriageReturn(line)
|
let mvn_classpath = s:RemoveCarriageReturn(line)
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
if stridx(line,'Dependencies classpath:') >= 0
|
if stridx(line, 'Dependencies classpath:') >= 0
|
||||||
let class_path_next = 1
|
let class_path_next = 1
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@ -340,6 +340,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
|||||||
|
|
||||||
let javac_opts = g:syntastic_java_javac_options
|
let javac_opts = g:syntastic_java_javac_options
|
||||||
|
|
||||||
|
let output_dir = ""
|
||||||
if g:syntastic_java_javac_delete_output
|
if g:syntastic_java_javac_delete_output
|
||||||
let output_dir = g:syntastic_java_javac_temp_dir
|
let output_dir = g:syntastic_java_javac_temp_dir
|
||||||
let javac_opts .= ' -d ' . output_dir
|
let javac_opts .= ' -d ' . output_dir
|
||||||
@ -353,19 +354,19 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
|||||||
let javac_classpath = ''
|
let javac_classpath = ''
|
||||||
|
|
||||||
" add classpathes to javac_classpath
|
" add classpathes to javac_classpath
|
||||||
for path in split(g:syntastic_java_javac_classpath,"\n")
|
for path in split(g:syntastic_java_javac_classpath, "\n")
|
||||||
if path != ''
|
if path != ''
|
||||||
try
|
try
|
||||||
let ps = glob(path,0,1)
|
let ps = glob(path, 0, 1)
|
||||||
catch
|
catch
|
||||||
let ps = split(glob(path,0),"\n")
|
let ps = split(glob(path, 0), "\n")
|
||||||
endtry
|
endtry
|
||||||
if type(ps) == type([])
|
if type(ps) == type([])
|
||||||
for p in ps
|
for p in ps
|
||||||
let javac_classpath = s:AddToClasspath(javac_classpath,p)
|
let javac_classpath = s:AddToClasspath(javac_classpath, p)
|
||||||
endfor
|
endfor
|
||||||
else
|
else
|
||||||
let javac_classpath = s:AddToClasspath(javac_classpath,ps)
|
let javac_classpath = s:AddToClasspath(javac_classpath, ps)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@ -381,7 +382,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
|||||||
if g:syntastic_java_javac_custom_classpath_command != ''
|
if g:syntastic_java_javac_custom_classpath_command != ''
|
||||||
let lines = system(g:syntastic_java_javac_custom_classpath_command)
|
let lines = system(g:syntastic_java_javac_custom_classpath_command)
|
||||||
if has('win32') || has('win32unix') || has('win64')
|
if has('win32') || has('win32unix') || has('win64')
|
||||||
let lines = substitute(lines,"\r\n","\n")
|
let lines = substitute(lines, "\r\n", "\n", 'g')
|
||||||
endif
|
endif
|
||||||
for l in split(lines, "\n")
|
for l in split(lines, "\n")
|
||||||
let javac_classpath = s:AddToClasspath(javac_classpath, l)
|
let javac_classpath = s:AddToClasspath(javac_classpath, l)
|
||||||
@ -420,7 +421,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
|||||||
\ '%-G%.%#'
|
\ '%-G%.%#'
|
||||||
|
|
||||||
if g:syntastic_java_javac_delete_output
|
if g:syntastic_java_javac_delete_output
|
||||||
silent! call mkdir(output_dir,'p')
|
silent! call mkdir(output_dir, 'p')
|
||||||
endif
|
endif
|
||||||
let errors = SyntasticMake({
|
let errors = SyntasticMake({
|
||||||
\ 'makeprg': makeprg,
|
\ 'makeprg': makeprg,
|
||||||
|
@ -19,7 +19,6 @@ let s:save_cpo = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
|
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
|
||||||
let wd = syntastic#util#shescape(expand("%:p:h") . "/")
|
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'args': '-X gnu -f elf' .
|
\ 'args': '-X gnu -f elf' .
|
||||||
\ ' -I ' . syntastic#util#shescape(expand("%:p:h") . "/") .
|
\ ' -I ' . syntastic#util#shescape(expand("%:p:h") . "/") .
|
||||||
|
@ -60,16 +60,18 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict
|
|||||||
\ 'EVL205': 3 })
|
\ 'EVL205': 3 })
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:filename)
|
||||||
function! s:vimlintOutput(filename, pos, ev, eid, mes, obj)
|
function! s:vimlintOutput(filename, pos, ev, eid, mes, obj)
|
||||||
let a:obj.error += [{
|
call add(a:obj.error, {
|
||||||
\ 'bufnr': bufnr(''),
|
\ 'bufnr': bufnr(''),
|
||||||
\ 'lnum': a:pos.lnum,
|
\ 'lnum': a:pos.lnum,
|
||||||
\ 'col': a:pos.col,
|
\ 'col': a:pos.col,
|
||||||
\ 'vcol': 0,
|
\ 'vcol': 0,
|
||||||
\ 'type': a:ev[0],
|
\ 'type': a:ev[0],
|
||||||
\ 'text': '[' . a:eid . '] ' . a:mes,
|
\ 'text': '[' . a:eid . '] ' . a:mes,
|
||||||
\ 'valid': 1 }]
|
\ 'valid': 1 })
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:filename)
|
||||||
|
|
||||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
\ 'filetype': 'vim',
|
\ 'filetype': 'vim',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user