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

Commit

Permalink
Cleanup: shut up lint warnings, formatting, doc nit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcd047 committed Jan 26, 2014
1 parent 49f9925 commit f3240e6
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 29 deletions.
1 change: 1 addition & 0 deletions autoload/syntastic/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ function! s:translateFilter(filters)
endfunction

function! s:translateElement(key, term)
let ret = "1"
if a:key ==? 'level'
let ret = 'v:val["type"] !=? ' . string(a:term[0])
elseif a:key ==? 'type'
Expand Down
2 changes: 1 addition & 1 deletion doc/syntastic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
'sh': >
set shell = 'bash'
set shell=bash
<

==============================================================================
Expand Down
30 changes: 22 additions & 8 deletions plugin/syntastic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ runtime! plugin/syntastic/*.vim

let s:running_windows = syntastic#util#isRunningWindows()

for feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
if !has(feature)
call syntastic#log#error("need Vim compiled with feature " . feature)
for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
if !has(s:feature)
call syntastic#log#error("need Vim compiled with feature " . s:feature)
finish
endif
endfor
Expand Down Expand Up @@ -96,12 +96,12 @@ endif
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")
if g:syntastic_quiet_warnings
let quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
if type(quiet_warnings) != type([])
let quiet_warnings = [quiet_warnings]
let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
if type(s:quiet_warnings) != type([])
let s:quiet_warnings = [s:quiet_warnings]
endif
call add(quiet_warnings, 'warnings')
let g:syntastic_quiet_messages['type'] = quiet_warnings
call add(s:quiet_warnings, 'warnings')
let g:syntastic_quiet_messages['type'] = s:quiet_warnings
endif
endif

Expand All @@ -118,6 +118,9 @@ let s:notifiers = g:SyntasticNotifiers.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)
let checker_names = []
for ft in s:CurrentFiletypes()
Expand All @@ -127,10 +130,21 @@ function! s:CompleteCheckerName(argLead, cmdLine, cursorPos)
endfor
return join(checker_names, "\n")
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)
return join(s:registry.knownFiletypes(), "\n")
endfunction
" @vimlint(EVL103, 0, a:cursorPos)
" @vimlint(EVL103, 0, a:cmdLine)
" @vimlint(EVL103, 0, a:argLead)


command! SyntasticToggleMode call s:ToggleMode()
command! -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck
Expand Down
2 changes: 2 additions & 0 deletions plugin/syntastic/balloons.vim
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ function! g:SyntasticBalloonsNotifier.refresh(loclist)
endfunction

" Reset the error balloons
" @vimlint(EVL103, 1, a:loclist)
function! g:SyntasticBalloonsNotifier.reset(loclist)
if has('balloon_eval')
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
set nobeval
endif
endfunction
" @vimlint(EVL103, 0, a:loclist)

" Private functions {{{1

Expand Down
2 changes: 2 additions & 0 deletions plugin/syntastic/cursor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ function! g:SyntasticCursorNotifier.refresh(loclist)
endif
endfunction

" @vimlint(EVL103, 1, a:loclist)
function! g:SyntasticCursorNotifier.reset(loclist)
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
autocmd! syntastic CursorMoved
unlet! b:syntastic_messages
let b:oldLine = -1
endfunction
" @vimlint(EVL103, 0, a:loclist)

" Private methods {{{1

Expand Down
2 changes: 2 additions & 0 deletions plugin/syntastic/highlighting.vim
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function! g:SyntasticHighlightingNotifier.refresh(loclist)
endfunction

" Remove all error highlights from the window
" @vimlint(EVL103, 1, a:loclist)
function! g:SyntasticHighlightingNotifier.reset(loclist)
if s:has_highlighting
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
Expand All @@ -72,6 +73,7 @@ function! g:SyntasticHighlightingNotifier.reset(loclist)
endfor
endif
endfunction
" @vimlint(EVL103, 0, a:loclist)

" Private methods {{{1

Expand Down
2 changes: 1 addition & 1 deletion syntax_checkers/glsl/cgc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function! s:GetProfile()
endif

return profile
endfunction!
endfunction

call g:SyntasticRegistry.CreateAndRegisterChecker({
\'filetype': 'glsl',
Expand Down
33 changes: 17 additions & 16 deletions syntax_checkers/java/javac.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
" 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
" 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")
Expand Down Expand Up @@ -96,7 +96,7 @@ function! s:RemoveDir(dir)
endif
endfunction

function! s:AddToClasspath(classpath,path)
function! s:AddToClasspath(classpath, path)
if a:path == ''
return a:classpath
endif
Expand Down Expand Up @@ -133,7 +133,7 @@ function! s:SaveClasspath()
let path = ''
let lines = getline(1, line('$'))
for l in lines
let path = s:AddToClasspath(path,l)
let path = s:AddToClasspath(path, l)
endfor
" save classpath to config file
if g:syntastic_java_javac_config_file_enabled
Expand All @@ -144,7 +144,7 @@ function! s:SaveClasspath()
let i = 0
while i < len(lines)
if match(lines[i], 'g:syntastic_java_javac_classpath') != -1
call remove(lines,i)
call remove(lines, i)
let i -= 1
endif
let i += 1
Expand All @@ -153,9 +153,9 @@ function! s:SaveClasspath()
let lines = []
endif
" 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
call writefile(lines,g:syntastic_java_javac_config_file)
call writefile(lines, g:syntastic_java_javac_config_file)
endif
" set new classpath
let g:syntastic_java_javac_classpath = path
Expand All @@ -167,7 +167,7 @@ function! s:EditClasspath()
let winnr = bufwinnr('^' . command . '$')
if winnr < 0
let path = []
let pathlines = split(g:syntastic_java_javac_classpath,"\n")
let pathlines = split(g:syntastic_java_javac_classpath, "\n")
for p in pathlines
let path += s:SplitClasspath(p)
endfor
Expand All @@ -192,7 +192,7 @@ function! s:SaveConfig()
let lines = getline(1, line('$'))
if g:syntastic_java_javac_config_file_enabled
" save config file lines
call writefile(lines,g:syntastic_java_javac_config_file)
call writefile(lines, g:syntastic_java_javac_config_file)
endif
let &modified = 0
endfunction
Expand Down Expand Up @@ -275,7 +275,7 @@ function! s:GetMavenClasspath()
let mvn_classpath = s:RemoveCarriageReturn(line)
break
endif
if stridx(line,'Dependencies classpath:') >= 0
if stridx(line, 'Dependencies classpath:') >= 0
let class_path_next = 1
endif
endfor
Expand Down Expand Up @@ -340,6 +340,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict

let javac_opts = g:syntastic_java_javac_options

let output_dir = ""
if g:syntastic_java_javac_delete_output
let output_dir = g:syntastic_java_javac_temp_dir
let javac_opts .= ' -d ' . output_dir
Expand All @@ -353,19 +354,19 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
let 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 != ''
try
let ps = glob(path,0,1)
let ps = glob(path, 0, 1)
catch
let ps = split(glob(path,0),"\n")
let ps = split(glob(path, 0), "\n")
endtry
if type(ps) == type([])
for p in ps
let javac_classpath = s:AddToClasspath(javac_classpath,p)
let javac_classpath = s:AddToClasspath(javac_classpath, p)
endfor
else
let javac_classpath = s:AddToClasspath(javac_classpath,ps)
let javac_classpath = s:AddToClasspath(javac_classpath, ps)
endif
endif
endfor
Expand All @@ -381,7 +382,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
if g:syntastic_java_javac_custom_classpath_command != ''
let lines = system(g:syntastic_java_javac_custom_classpath_command)
if has('win32') || has('win32unix') || has('win64')
let lines = substitute(lines,"\r\n","\n")
let lines = substitute(lines, "\r\n", "\n", 'g')
endif
for l in split(lines, "\n")
let javac_classpath = s:AddToClasspath(javac_classpath, l)
Expand Down Expand Up @@ -420,7 +421,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
\ '%-G%.%#'

if g:syntastic_java_javac_delete_output
silent! call mkdir(output_dir,'p')
silent! call mkdir(output_dir, 'p')
endif
let errors = SyntasticMake({
\ 'makeprg': makeprg,
Expand Down
1 change: 0 additions & 1 deletion syntax_checkers/nasm/nasm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ let s:save_cpo = &cpo
set cpo&vim

function! SyntaxCheckers_nasm_nasm_GetLocList() dict
let wd = syntastic#util#shescape(expand("%:p:h") . "/")
let makeprg = self.makeprgBuild({
\ 'args': '-X gnu -f elf' .
\ ' -I ' . syntastic#util#shescape(expand("%:p:h") . "/") .
Expand Down
6 changes: 4 additions & 2 deletions syntax_checkers/vim/vimlint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict
\ 'EVL205': 3 })
endfunction

" @vimlint(EVL103, 1, a:filename)
function! s:vimlintOutput(filename, pos, ev, eid, mes, obj)
let a:obj.error += [{
call add(a:obj.error, {
\ 'bufnr': bufnr(''),
\ 'lnum': a:pos.lnum,
\ 'col': a:pos.col,
\ 'vcol': 0,
\ 'type': a:ev[0],
\ 'text': '[' . a:eid . '] ' . a:mes,
\ 'valid': 1 }]
\ 'valid': 1 })
endfunction
" @vimlint(EVL103, 0, a:filename)

call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vim',
Expand Down

0 comments on commit f3240e6

Please sign in to comment.