diff --git a/autoload/syntastic/util.vim b/autoload/syntastic/util.vim index a53ff11d..1a1733b7 100644 --- a/autoload/syntastic/util.vim +++ b/autoload/syntastic/util.vim @@ -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' diff --git a/doc/syntastic.txt b/doc/syntastic.txt index 36cf3d77..4fe04b0e 100644 --- a/doc/syntastic.txt +++ b/doc/syntastic.txt @@ -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 < ============================================================================== diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index f08f1126..afe887c7 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -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 @@ -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 @@ -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() @@ -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 diff --git a/plugin/syntastic/balloons.vim b/plugin/syntastic/balloons.vim index 4b6735c3..c2630342 100644 --- a/plugin/syntastic/balloons.vim +++ b/plugin/syntastic/balloons.vim @@ -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 diff --git a/plugin/syntastic/cursor.vim b/plugin/syntastic/cursor.vim index 0ee8caff..ad2b2c12 100644 --- a/plugin/syntastic/cursor.vim +++ b/plugin/syntastic/cursor.vim @@ -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 diff --git a/plugin/syntastic/highlighting.vim b/plugin/syntastic/highlighting.vim index b48d10cd..11941700 100644 --- a/plugin/syntastic/highlighting.vim +++ b/plugin/syntastic/highlighting.vim @@ -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') @@ -72,6 +73,7 @@ function! g:SyntasticHighlightingNotifier.reset(loclist) endfor endif endfunction +" @vimlint(EVL103, 0, a:loclist) " Private methods {{{1 diff --git a/syntax_checkers/glsl/cgc.vim b/syntax_checkers/glsl/cgc.vim index d27a00d1..26be92bd 100644 --- a/syntax_checkers/glsl/cgc.vim +++ b/syntax_checkers/glsl/cgc.vim @@ -65,7 +65,7 @@ function! s:GetProfile() endif return profile -endfunction! +endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ \'filetype': 'glsl', diff --git a/syntax_checkers/java/javac.vim b/syntax_checkers/java/javac.vim index b9d8bde8..88ee5618 100644 --- a/syntax_checkers/java/javac.vim +++ b/syntax_checkers/java/javac.vim @@ -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") @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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, diff --git a/syntax_checkers/nasm/nasm.vim b/syntax_checkers/nasm/nasm.vim index 95d77cb3..059f2311 100644 --- a/syntax_checkers/nasm/nasm.vim +++ b/syntax_checkers/nasm/nasm.vim @@ -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") . "/") . diff --git a/syntax_checkers/vim/vimlint.vim b/syntax_checkers/vim/vimlint.vim index b78a3b6e..a5041784 100644 --- a/syntax_checkers/vim/vimlint.vim +++ b/syntax_checkers/vim/vimlint.vim @@ -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',