mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -47,7 +47,7 @@ endfunction
|
||||
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': (g:syntastic_actionscript_mxmlc_conf != '' ?
|
||||
\ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''),
|
||||
\ ' -load-config+=' . syntastic#util#shexpand(g:syntastic_actionscript_mxmlc_conf) : ''),
|
||||
\ 'args_after': '-output=' . syntastic#util#DevNull() })
|
||||
|
||||
let errorformat =
|
||||
|
@ -30,7 +30,6 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_oclint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-text',
|
||||
\ 'post_args_before': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
|
||||
|
||||
let errorformat =
|
||||
@ -42,12 +41,16 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace', 'sort'],
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'returns': [0, 3, 5] })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -35,8 +35,11 @@ function! SyntaxCheckers_c_splint_GetLocList() dict
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%W%f:%l:%v: %m,' .
|
||||
\ '%W%f(%l\,%v): %m,' .
|
||||
\ '%W%f:%l: %m,' .
|
||||
\ '%W%f(%l): %m,' .
|
||||
\ '%-C %\+In file included from %.%#,' .
|
||||
\ '%-C %\+from %.%#,' .
|
||||
\ '%+C %.%#'
|
||||
|
@ -43,13 +43,14 @@ function! SyntaxCheckers_css_prettycss_GetLocList() dict
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
|
||||
for e in loclist
|
||||
let e["text"] .= ')'
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
|
@ -19,22 +19,28 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': self.getExecEscaped() . ' check',
|
||||
\ 'args': get(g:, 'hdevtools_options', '') })
|
||||
if exists('g:hdevtools_options')
|
||||
let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
|
||||
endif
|
||||
|
||||
let errorformat= '\%-Z\ %#,'.
|
||||
\ '%W%f:%l:%c:\ Warning:\ %m,'.
|
||||
\ '%W%f:%l:%c:\ Warning:,'.
|
||||
\ '%E%f:%l:%c:\ %m,'.
|
||||
\ '%E%>%f:%l:%c:,'.
|
||||
\ '%+C\ \ %#%m,'.
|
||||
\ '%W%>%f:%l:%c:,'.
|
||||
\ '%+C\ \ %#%tarning:\ %m,'
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe_after': 'check',
|
||||
\ 'fname': syntastic#util#shexpand('%:p') })
|
||||
|
||||
let errorformat =
|
||||
\ '%-Z %#,'.
|
||||
\ '%W%f:%l:%v: Warning: %m,'.
|
||||
\ '%W%f:%l:%v: Warning:,'.
|
||||
\ '%E%f:%l:%v: %m,'.
|
||||
\ '%E%>%f:%l:%v:,'.
|
||||
\ '%+C %#%m,'.
|
||||
\ '%W%>%f:%l:%v:,'.
|
||||
\ '%+C %#%tarning: %m,'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'vcol': 1},
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
|
@ -14,16 +14,18 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'fname': syntastic#util#shexpand('%:p')})
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: Error: %m,' .
|
||||
\ '%W%f:%l:%c: Warning: %m,' .
|
||||
\ '%E%f:%l:%v: Error: %m,' .
|
||||
\ '%W%f:%l:%v: Warning: %m,' .
|
||||
\ '%C%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'vcol': 1},
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: scan.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" 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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_haskell_scan_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_scan_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_scan_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%l:%v: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'scan'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -34,7 +34,8 @@ endfunction
|
||||
function! SyntaxCheckers_html_jshint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': expand(g:syntastic_jshint_exec),
|
||||
\ 'args': (g:syntastic_html_jshint_conf != '' ? '--config ' . g:syntastic_html_jshint_conf : ''),
|
||||
\ 'args': (g:syntastic_html_jshint_conf != '' ?
|
||||
\ '--config ' . syntastic#util#shexpand(g:syntastic_html_jshint_conf) : ''),
|
||||
\ 'args_after': '--verbose --extract always' })
|
||||
|
||||
let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'
|
||||
|
@ -10,7 +10,15 @@
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Checker option:
|
||||
" Note: if you need to check HTML5 sources, you might consider installing a
|
||||
" fork of HTML Tidy, named "HTML Tidy for HTML5":
|
||||
"
|
||||
" http://w3c.github.io/tidy-html5/
|
||||
"
|
||||
" HTML Tidy for HTML5 can be used without changes by this checker, just install
|
||||
" it and point g:syntastic_html_tidy_exec to the executable.
|
||||
"
|
||||
" Checker options:
|
||||
"
|
||||
" - g:syntastic_html_tidy_ignore_errors (list; default: [])
|
||||
" list of errors to ignore
|
||||
@ -48,108 +56,108 @@ set cpo&vim
|
||||
" TODO: join this with xhtml.vim for DRY's sake?
|
||||
function! s:TidyEncOptByFenc()
|
||||
let tidy_opts = {
|
||||
\'utf-8': '-utf8',
|
||||
\'ascii': '-ascii',
|
||||
\'latin1': '-latin1',
|
||||
\'iso-2022-jp': '-iso-2022',
|
||||
\'cp1252': '-win1252',
|
||||
\'macroman': '-mac',
|
||||
\'utf-16le': '-utf16le',
|
||||
\'utf-16': '-utf16',
|
||||
\'big5': '-big5',
|
||||
\'cp932': '-shiftjis',
|
||||
\'sjis': '-shiftjis',
|
||||
\'cp850': '-ibm858',
|
||||
\}
|
||||
\ 'utf-8': '-utf8',
|
||||
\ 'ascii': '-ascii',
|
||||
\ 'latin1': '-latin1',
|
||||
\ 'iso-2022-jp': '-iso-2022',
|
||||
\ 'cp1252': '-win1252',
|
||||
\ 'macroman': '-mac',
|
||||
\ 'utf-16le': '-utf16le',
|
||||
\ 'utf-16': '-utf16',
|
||||
\ 'big5': '-big5',
|
||||
\ 'cp932': '-shiftjis',
|
||||
\ 'sjis': '-shiftjis',
|
||||
\ 'cp850': '-ibm858',
|
||||
\ }
|
||||
return get(tidy_opts, &fileencoding, '-utf8')
|
||||
endfunction
|
||||
|
||||
let s:ignore_errors = [
|
||||
\ "<table> lacks \"summary\" attribute",
|
||||
\ "not approved by W3C",
|
||||
\ "<input> proprietary attribute \"placeholder\"",
|
||||
\ "<meta> proprietary attribute \"charset\"",
|
||||
\ "<meta> lacks \"content\" attribute",
|
||||
\ "inserting \"type\" attribute",
|
||||
\ "proprietary attribute \"data-",
|
||||
\ "missing <!DOCTYPE> declaration",
|
||||
\ "inserting implicit <body>",
|
||||
\ "inserting missing 'title' element",
|
||||
\ "unescaped & or unknown entity",
|
||||
\ "<input> attribute \"type\" has invalid value",
|
||||
\ "proprietary attribute \"role\"",
|
||||
\ "proprietary attribute \"aria-activedescendant\"",
|
||||
\ "proprietary attribute \"aria-atomic\"",
|
||||
\ "proprietary attribute \"aria-autocomplete\"",
|
||||
\ "proprietary attribute \"aria-busy\"",
|
||||
\ "proprietary attribute \"aria-checked\"",
|
||||
\ "proprietary attribute \"aria-controls\"",
|
||||
\ "proprietary attribute \"aria-describedby\"",
|
||||
\ "proprietary attribute \"aria-disabled\"",
|
||||
\ "proprietary attribute \"aria-dropeffect\"",
|
||||
\ "proprietary attribute \"aria-expanded\"",
|
||||
\ "proprietary attribute \"aria-flowto\"",
|
||||
\ "proprietary attribute \"aria-grabbed\"",
|
||||
\ "proprietary attribute \"aria-haspopup\"",
|
||||
\ "proprietary attribute \"aria-hidden\"",
|
||||
\ "proprietary attribute \"aria-invalid\"",
|
||||
\ "proprietary attribute \"aria-label\"",
|
||||
\ "proprietary attribute \"aria-labelledby\"",
|
||||
\ "proprietary attribute \"aria-level\"",
|
||||
\ "proprietary attribute \"aria-live\"",
|
||||
\ "proprietary attribute \"aria-multiline\"",
|
||||
\ "proprietary attribute \"aria-multiselectable\"",
|
||||
\ "proprietary attribute \"aria-orientation\"",
|
||||
\ "proprietary attribute \"aria-owns\"",
|
||||
\ "proprietary attribute \"aria-posinset\"",
|
||||
\ "proprietary attribute \"aria-pressed\"",
|
||||
\ "proprietary attribute \"aria-readonly\"",
|
||||
\ "proprietary attribute \"aria-relevant\"",
|
||||
\ "proprietary attribute \"aria-relevant\"",
|
||||
\ "proprietary attribute \"aria-required\"",
|
||||
\ "proprietary attribute \"aria-selected\"",
|
||||
\ "proprietary attribute \"aria-setsize\"",
|
||||
\ "proprietary attribute \"aria-sort\"",
|
||||
\ "proprietary attribute \"aria-valuemax\"",
|
||||
\ "proprietary attribute \"aria-valuemin\"",
|
||||
\ "proprietary attribute \"aria-valuenow\"",
|
||||
\ "proprietary attribute \"aria-valuetext\""
|
||||
\ ]
|
||||
\ "<table> lacks \"summary\" attribute",
|
||||
\ "not approved by W3C",
|
||||
\ "<input> proprietary attribute \"placeholder\"",
|
||||
\ "<meta> proprietary attribute \"charset\"",
|
||||
\ "<meta> lacks \"content\" attribute",
|
||||
\ "inserting \"type\" attribute",
|
||||
\ "proprietary attribute \"data-",
|
||||
\ "missing <!DOCTYPE> declaration",
|
||||
\ "inserting implicit <body>",
|
||||
\ "inserting missing 'title' element",
|
||||
\ "unescaped & or unknown entity",
|
||||
\ "<input> attribute \"type\" has invalid value",
|
||||
\ "proprietary attribute \"role\"",
|
||||
\ "proprietary attribute \"aria-activedescendant\"",
|
||||
\ "proprietary attribute \"aria-atomic\"",
|
||||
\ "proprietary attribute \"aria-autocomplete\"",
|
||||
\ "proprietary attribute \"aria-busy\"",
|
||||
\ "proprietary attribute \"aria-checked\"",
|
||||
\ "proprietary attribute \"aria-controls\"",
|
||||
\ "proprietary attribute \"aria-describedby\"",
|
||||
\ "proprietary attribute \"aria-disabled\"",
|
||||
\ "proprietary attribute \"aria-dropeffect\"",
|
||||
\ "proprietary attribute \"aria-expanded\"",
|
||||
\ "proprietary attribute \"aria-flowto\"",
|
||||
\ "proprietary attribute \"aria-grabbed\"",
|
||||
\ "proprietary attribute \"aria-haspopup\"",
|
||||
\ "proprietary attribute \"aria-hidden\"",
|
||||
\ "proprietary attribute \"aria-invalid\"",
|
||||
\ "proprietary attribute \"aria-label\"",
|
||||
\ "proprietary attribute \"aria-labelledby\"",
|
||||
\ "proprietary attribute \"aria-level\"",
|
||||
\ "proprietary attribute \"aria-live\"",
|
||||
\ "proprietary attribute \"aria-multiline\"",
|
||||
\ "proprietary attribute \"aria-multiselectable\"",
|
||||
\ "proprietary attribute \"aria-orientation\"",
|
||||
\ "proprietary attribute \"aria-owns\"",
|
||||
\ "proprietary attribute \"aria-posinset\"",
|
||||
\ "proprietary attribute \"aria-pressed\"",
|
||||
\ "proprietary attribute \"aria-readonly\"",
|
||||
\ "proprietary attribute \"aria-relevant\"",
|
||||
\ "proprietary attribute \"aria-relevant\"",
|
||||
\ "proprietary attribute \"aria-required\"",
|
||||
\ "proprietary attribute \"aria-selected\"",
|
||||
\ "proprietary attribute \"aria-setsize\"",
|
||||
\ "proprietary attribute \"aria-sort\"",
|
||||
\ "proprietary attribute \"aria-valuemax\"",
|
||||
\ "proprietary attribute \"aria-valuemin\"",
|
||||
\ "proprietary attribute \"aria-valuenow\"",
|
||||
\ "proprietary attribute \"aria-valuetext\""
|
||||
\ ]
|
||||
|
||||
let s:blocklevel_tags = [
|
||||
\ "main",
|
||||
\ "section",
|
||||
\ "article",
|
||||
\ "aside",
|
||||
\ "header",
|
||||
\ "footer",
|
||||
\ "nav",
|
||||
\ "figure",
|
||||
\ "figcaption"
|
||||
\ ]
|
||||
\ "main",
|
||||
\ "section",
|
||||
\ "article",
|
||||
\ "aside",
|
||||
\ "header",
|
||||
\ "footer",
|
||||
\ "nav",
|
||||
\ "figure",
|
||||
\ "figcaption"
|
||||
\ ]
|
||||
|
||||
let s:inline_tags = [
|
||||
\ "video",
|
||||
\ "audio",
|
||||
\ "source",
|
||||
\ "embed",
|
||||
\ "mark",
|
||||
\ "progress",
|
||||
\ "meter",
|
||||
\ "time",
|
||||
\ "ruby",
|
||||
\ "rt",
|
||||
\ "rp",
|
||||
\ "canvas",
|
||||
\ "command",
|
||||
\ "details",
|
||||
\ "datalist"
|
||||
\ ]
|
||||
\ "video",
|
||||
\ "audio",
|
||||
\ "source",
|
||||
\ "embed",
|
||||
\ "mark",
|
||||
\ "progress",
|
||||
\ "meter",
|
||||
\ "time",
|
||||
\ "ruby",
|
||||
\ "rt",
|
||||
\ "rp",
|
||||
\ "canvas",
|
||||
\ "command",
|
||||
\ "details",
|
||||
\ "datalist"
|
||||
\ ]
|
||||
|
||||
let s:empty_tags = [
|
||||
\ "wbr",
|
||||
\ "keygen"
|
||||
\ ]
|
||||
\ "wbr",
|
||||
\ "keygen"
|
||||
\ ]
|
||||
|
||||
function! s:IgnoreError(text)
|
||||
for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors
|
||||
|
@ -37,8 +37,9 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-cp ' . g:syntastic_java_checkstyle_classpath .
|
||||
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file .
|
||||
\ ' -f xml',
|
||||
\ ' com.puppycrawl.tools.checkstyle.Main -c ' .
|
||||
\ syntastic#util#shexpand(g:syntastic_java_checkstyle_conf_file) .
|
||||
\ ' -f xml',
|
||||
\ 'fname': fname })
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%m'
|
||||
|
@ -43,7 +43,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:CygwinPath(path)
|
||||
return substitute(system("cygpath -m " . a:path), '\n', '', 'g')
|
||||
return substitute(system("cygpath -m " . syntastic#util#shescape(a:path)), '\n', '', 'g')
|
||||
endfunction
|
||||
|
||||
if !exists("g:syntastic_java_javac_temp_dir")
|
||||
@ -123,8 +123,8 @@ function! s:SplitClasspath(classpath)
|
||||
endfunction
|
||||
|
||||
function! s:LoadConfigFile()
|
||||
if filereadable(g:syntastic_java_javac_config_file)
|
||||
exe 'source '.g:syntastic_java_javac_config_file
|
||||
if filereadable(expand(g:syntastic_java_javac_config_file))
|
||||
exe 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -137,9 +137,9 @@ function! s:SaveClasspath()
|
||||
endfor
|
||||
" save classpath to config file
|
||||
if g:syntastic_java_javac_config_file_enabled
|
||||
if filereadable(g:syntastic_java_javac_config_file)
|
||||
if filereadable(expand(g:syntastic_java_javac_config_file))
|
||||
" load lines from config file
|
||||
let lines = readfile(g:syntastic_java_javac_config_file)
|
||||
let lines = readfile(expand(g:syntastic_java_javac_config_file))
|
||||
" strip g:syntastic_java_javac_classpath options from config file lines
|
||||
let i = 0
|
||||
while i < len(lines)
|
||||
@ -155,7 +155,7 @@ function! s:SaveClasspath()
|
||||
" add new g:syntastic_java_javac_classpath option to config
|
||||
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, expand(g:syntastic_java_javac_config_file))
|
||||
endif
|
||||
" set new classpath
|
||||
let g:syntastic_java_javac_classpath = path
|
||||
@ -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, expand(g:syntastic_java_javac_config_file))
|
||||
endif
|
||||
let &modified = 0
|
||||
endfunction
|
||||
@ -202,8 +202,8 @@ function! s:EditConfig()
|
||||
let winnr = bufwinnr('^' . command . '$')
|
||||
if winnr < 0
|
||||
let lines = []
|
||||
if filereadable(g:syntastic_java_javac_config_file)
|
||||
let lines = readfile(g:syntastic_java_javac_config_file)
|
||||
if filereadable(expand(g:syntastic_java_javac_config_file))
|
||||
let lines = readfile(expand(g:syntastic_java_javac_config_file))
|
||||
endif
|
||||
execute (len(lines) + 5) . 'sp ' . fnameescape(command)
|
||||
|
||||
@ -329,7 +329,7 @@ function! s:MavenOutputDirectory()
|
||||
endif
|
||||
|
||||
if has('win32unix')
|
||||
let output_dir=s:CygwinPath(output_dir)
|
||||
let output_dir = s:CygwinPath(output_dir)
|
||||
endif
|
||||
return output_dir
|
||||
endif
|
||||
@ -408,7 +408,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
||||
let fname = fnameescape(expand ( '%:p:h' ) . sep . expand ( '%:t' ))
|
||||
|
||||
if has('win32unix')
|
||||
let fname = s:CygwinPath(fname)
|
||||
let fname = s:CygwinPath(fname)
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
|
@ -21,22 +21,31 @@ endif
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
|
||||
return
|
||||
\ executable('eslint') &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('eslint --version'), [0, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (g:syntastic_javascript_eslint_conf != '' ? '--config ' . g:syntastic_javascript_eslint_conf : '') })
|
||||
\ 'args_before': '-f compact',
|
||||
\ 'args': (g:syntastic_javascript_eslint_conf != '' ?
|
||||
\ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_eslint_conf) : '') })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f: line %l\, col %c\, Error - %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
for e in loclist
|
||||
let e['col'] += 1
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
|
@ -19,14 +19,19 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jscs_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '--no-colors --reporter checkstyle' })
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%m'
|
||||
return SyntasticMake({
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'preprocess': 'checkstyle',
|
||||
\ 'postprocess': ['sort'],
|
||||
\ 'returns': [0, 2] })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -25,19 +25,22 @@ function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
|
||||
if !exists('g:syntastic_jshint_exec')
|
||||
let g:syntastic_jshint_exec = self.getExec()
|
||||
endif
|
||||
return executable(expand(g:syntastic_jshint_exec))
|
||||
if !executable(expand(g:syntastic_jshint_exec))
|
||||
return 0
|
||||
endif
|
||||
let s:jshint_version = syntastic#util#getVersion(syntastic#util#shexpand(g:syntastic_jshint_exec) . ' --version')
|
||||
return syntastic#util#versionIsAtLeast(s:jshint_version, [1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_GetLocList() dict
|
||||
let exe = syntastic#util#shexpand(g:syntastic_jshint_exec)
|
||||
if !exists('s:jshint_new')
|
||||
let s:jshint_new =
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 1])
|
||||
let s:jshint_new = syntastic#util#versionIsAtLeast(s:jshint_version, [1, 1])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': exe,
|
||||
\ 'args': (g:syntastic_javascript_jshint_conf != '' ? '--config ' . g:syntastic_javascript_jshint_conf : ''),
|
||||
\ 'exe': syntastic#util#shexpand(g:syntastic_jshint_exec),
|
||||
\ 'args': (g:syntastic_javascript_jshint_conf != '' ?
|
||||
\ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_jshint_conf) : ''),
|
||||
\ 'args_after': (s:jshint_new ? '--verbose ' : '') })
|
||||
|
||||
let errorformat = s:jshint_new ?
|
||||
|
@ -23,7 +23,8 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (g:syntastic_javascript_jsl_conf != '' ? '-conf ' . g:syntastic_javascript_jsl_conf : ''),
|
||||
\ 'args': (g:syntastic_javascript_jsl_conf != '' ?
|
||||
\ '-conf ' . syntastic#util#shexpand(g:syntastic_javascript_jsl_conf) : ''),
|
||||
\ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' })
|
||||
|
||||
let errorformat =
|
||||
|
@ -18,10 +18,6 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
|
||||
if !executable('jshint') || !syntastic#util#versionIsAtLeast(syntastic#util#getVersion('jshint --version'), [1, 1])
|
||||
return 0
|
||||
endif
|
||||
|
||||
let jsxhint_version = system(self.getExecEscaped() . ' --version')
|
||||
return
|
||||
\ v:shell_error == 0 &&
|
||||
|
@ -32,8 +32,7 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" adjust for weirdness in each checker
|
||||
for e in loclist
|
||||
@ -53,6 +52,8 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
|
||||
endif
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
|
@ -32,10 +32,9 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
|
||||
\ '%-Z%p^%.%#,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist=SyntasticMake({
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'],
|
||||
\ 'returns': range(32) })
|
||||
|
||||
for e in loclist
|
||||
@ -55,6 +54,8 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
|
||||
let e['vcol'] = 0
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
@ -63,9 +64,10 @@ function! s:PylintNew(exe)
|
||||
try
|
||||
" On Windows the version is shown as "pylint-script.py 1.0.0".
|
||||
" On Gentoo Linux it's "pylint-python2.7 0.28.0".
|
||||
" On NixOS, that would be ".pylint-wrapped 0.26.0", that would be.
|
||||
" On NixOS, that would be ".pylint-wrapped 0.26.0".
|
||||
" On Arch Linux it's "pylint2 1.1.0".
|
||||
" Have you guys considered switching to creative writing yet? ;)
|
||||
let pylint_version = filter(split(system(exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^\.\=pylint\>''')[0]
|
||||
let pylint_version = filter(split(system(exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^\.\=pylint[-0-9]*\>''')[0]
|
||||
let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '')
|
||||
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
|
78
sources_non_forked/syntastic/syntax_checkers/r/lint.vim
Normal file
78
sources_non_forked/syntastic/syntax_checkers/r/lint.vim
Normal file
@ -0,0 +1,78 @@
|
||||
"============================================================================
|
||||
"File: lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" 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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_r_lint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_r_lint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_r_lint_styles')
|
||||
let g:syntastic_r_lint_styles = 'lint.style'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_r_lint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m`\zs[^`]\+\ze`')
|
||||
if term == ''
|
||||
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
|
||||
endif
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lint_GetLocList() dict
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape('library(lint); try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
|
||||
let errorformat =
|
||||
\ '%t:%f:%l:%v: %m,' .
|
||||
\ '%t:%f:%l: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'preprocess': 'rparse',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] == 'F'
|
||||
" parse error
|
||||
let e['type'] = 'E'
|
||||
call remove(e, 'subtype')
|
||||
endif
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'r',
|
||||
\ 'name': 'lint',
|
||||
\ 'exec': 'R' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
77
sources_non_forked/syntastic/syntax_checkers/r/svtools.vim
Normal file
77
sources_non_forked/syntastic/syntax_checkers/r/svtools.vim
Normal file
@ -0,0 +1,77 @@
|
||||
"============================================================================
|
||||
"File: svtools.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Security:
|
||||
"
|
||||
" This checker runs the code in your file. This is probably fine if you
|
||||
" wrote the file yourself, but it can be a problem if you're trying to
|
||||
" check third party files. If you are 100% willing to let Vim run the
|
||||
" code in your file, set g:syntastic_enable_r_svtools_checker to 1 in
|
||||
" your vimrc to enable this checker:
|
||||
"
|
||||
" let g:syntastic_enable_r_svtools_checker = 1
|
||||
|
||||
if exists("g:loaded_syntastic_r_svtools_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_r_svtools_checker = 1
|
||||
|
||||
if !exists('g:syntastic_r_svtools_styles')
|
||||
let g:syntastic_r_svtools_styles = 'lint.style'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_r_svtools_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_svtools_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_svtools_GetLocList() dict
|
||||
if !exists('g:syntastic_enable_r_svtools_checker') || !g:syntastic_enable_r_svtools_checker
|
||||
call syntastic#log#error('checker r/svtools: checks disabled for security reasons; set g:syntastic_enable_r_svtools_checker to 1 to override')
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape('library(svTools); ' .
|
||||
\ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
|
||||
let errorformat =
|
||||
\ '%trror:%f:%\s%#%l:%\s%#%v:%m,' .
|
||||
\ '%tarning:%f:%\s%#%l:%\s%#%v:%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'r',
|
||||
\ 'name': 'svtools',
|
||||
\ 'exec': 'R' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -38,13 +38,14 @@ function! SyntaxCheckers_racket_code_ayatollah_GetLocList() dict
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
for e in loclist
|
||||
let e['col'] += 1
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
|
@ -45,11 +45,14 @@ function! SyntaxCheckers_tex_chktex_GetLocList() dict
|
||||
\ '%Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -23,11 +23,14 @@ function! SyntaxCheckers_typescript_tsc_GetLocList() dict
|
||||
\ '%Eerror %m,' .
|
||||
\ '%C%\s%\+%m'
|
||||
|
||||
return SyntasticMake({
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -36,14 +36,9 @@ function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_vim_vimlint_IsAvailable() dict
|
||||
let ret = 0
|
||||
try
|
||||
call vimlint#vimlint(syntastic#util#DevNull(), { 'output': [], 'quiet': 1 })
|
||||
let ret = 1
|
||||
catch /\m^Vim\%((\a\+)\)\=:E117/
|
||||
" do nothing
|
||||
endtry
|
||||
return ret
|
||||
return
|
||||
\ globpath(&runtimepath, 'autoload/vimlparser.vim') != '' &&
|
||||
\ globpath(&runtimepath, 'autoload/vimlint.vim') != ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_vim_vimlint_GetLocList() dict
|
||||
|
@ -30,19 +30,19 @@ set cpo&vim
|
||||
" TODO: join this with html.vim DRY's sake?
|
||||
function! s:TidyEncOptByFenc()
|
||||
let tidy_opts = {
|
||||
\'utf-8': '-utf8',
|
||||
\'ascii': '-ascii',
|
||||
\'latin1': '-latin1',
|
||||
\'iso-2022-jp': '-iso-2022',
|
||||
\'cp1252': '-win1252',
|
||||
\'macroman': '-mac',
|
||||
\'utf-16le': '-utf16le',
|
||||
\'utf-16': '-utf16',
|
||||
\'big5': '-big5',
|
||||
\'cp932': '-shiftjis',
|
||||
\'sjis': '-shiftjis',
|
||||
\'cp850': '-ibm858',
|
||||
\}
|
||||
\ 'utf-8': '-utf8',
|
||||
\ 'ascii': '-ascii',
|
||||
\ 'latin1': '-latin1',
|
||||
\ 'iso-2022-jp': '-iso-2022',
|
||||
\ 'cp1252': '-win1252',
|
||||
\ 'macroman': '-mac',
|
||||
\ 'utf-16le': '-utf16le',
|
||||
\ 'utf-16': '-utf16',
|
||||
\ 'big5': '-big5',
|
||||
\ 'cp932': '-shiftjis',
|
||||
\ 'sjis': '-shiftjis',
|
||||
\ 'cp850': '-ibm858',
|
||||
\ }
|
||||
return get(tidy_opts, &fileencoding, '-utf8')
|
||||
endfunction
|
||||
|
||||
|
42
sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim
Normal file
42
sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim
Normal file
@ -0,0 +1,42 @@
|
||||
"============================================================================
|
||||
"File: plutil.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" 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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_xml_plutil_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_xml_plutil_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_xml_plutil_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': '-lint -s',
|
||||
\ 'fname_before': '--' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f: %m at line %l'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'xml',
|
||||
\ 'name': 'plutil'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
Reference in New Issue
Block a user