Merge branch 'master' into gcc_refactor
This commit is contained in:
commit
10e4f91ae0
@ -214,8 +214,8 @@ function! s:CacheErrors(...)
|
|||||||
|
|
||||||
if !empty(names)
|
if !empty(names)
|
||||||
if len(syntastic#util#unique(map(copy(names), 'v:val[1]'))) == 1
|
if len(syntastic#util#unique(map(copy(names), 'v:val[1]'))) == 1
|
||||||
let name = join(map(names, 'v:val[0]'), ', ')
|
|
||||||
let type = names[0][1]
|
let type = names[0][1]
|
||||||
|
let name = join(map(names, 'v:val[0]'), ', ')
|
||||||
call newLoclist.setName( name . ' ('. type . ')' )
|
call newLoclist.setName( name . ' ('. type . ')' )
|
||||||
else
|
else
|
||||||
" checkers from mixed types
|
" checkers from mixed types
|
||||||
@ -388,7 +388,7 @@ function! SyntasticMake(options)
|
|||||||
|
|
||||||
let $LC_MESSAGES = 'C'
|
let $LC_MESSAGES = 'C'
|
||||||
let $LC_ALL = ''
|
let $LC_ALL = ''
|
||||||
let err_lines = system(a:options['makeprg'])
|
let err_lines = split(system(a:options['makeprg']), "\n", 1)
|
||||||
let $LC_ALL = old_lc_all
|
let $LC_ALL = old_lc_all
|
||||||
let $LC_MESSAGES = old_lc_messages
|
let $LC_MESSAGES = old_lc_messages
|
||||||
|
|
||||||
|
@ -157,11 +157,17 @@ function! g:SyntasticLoclist.show()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" try to find the loclist window and set w:quickfix_title
|
" try to find the loclist window and set w:quickfix_title
|
||||||
|
let errors = getloclist(0)
|
||||||
for buf in tabpagebuflist()
|
for buf in tabpagebuflist()
|
||||||
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
|
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
|
||||||
let win = bufwinnr(buf)
|
let win = bufwinnr(buf)
|
||||||
let title = getwinvar(win, 'quickfix_title')
|
let title = getwinvar(win, 'quickfix_title')
|
||||||
if title ==# ':setloclist()' || strpart(title, 0, 16) ==# ':SyntasticCheck '
|
|
||||||
|
" TODO: try to make sure we actually own this window; sadly,
|
||||||
|
" errors == getloclist(0) is the only somewhat safe way to
|
||||||
|
" achieve that
|
||||||
|
if strpart(title, 0, 16) ==# ':SyntasticCheck ' ||
|
||||||
|
\ ( (title == '' || title ==# ':setloclist()') && errors == getloclist(0) )
|
||||||
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
|
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -31,7 +31,7 @@ endfunction
|
|||||||
function! SyntaxCheckers_puppet_puppetlint_GetLocList()
|
function! SyntaxCheckers_puppet_puppetlint_GetLocList()
|
||||||
let makeprg = syntastic#makeprg#build({
|
let makeprg = syntastic#makeprg#build({
|
||||||
\ 'exe': 'puppet-lint',
|
\ 'exe': 'puppet-lint',
|
||||||
\ 'post_args': '--log-format "\%{KIND} [\%{check}] \%{message} at \%{fullpath}:\%{linenumber}"',
|
\ 'post_args': '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:%{linenumber}"',
|
||||||
\ 'filetype': 'puppet',
|
\ 'filetype': 'puppet',
|
||||||
\ 'subchecker': 'puppetlint' })
|
\ 'subchecker': 'puppetlint' })
|
||||||
|
|
||||||
|
50
syntax_checkers/python/pep257.vim
Normal file
50
syntax_checkers/python/pep257.vim
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
"============================================================================
|
||||||
|
"File: pep257.vim
|
||||||
|
"Description: Docstring style checking plugin for syntastic.vim
|
||||||
|
"============================================================================
|
||||||
|
"
|
||||||
|
" For details about pep257 see: https://github.com/GreenSteam/pep257
|
||||||
|
|
||||||
|
if exists("g:loaded_syntastic_python_pep257_checker")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_syntastic_python_pep257_checker = 1
|
||||||
|
|
||||||
|
function! SyntaxCheckers_python_pep257_IsAvailable()
|
||||||
|
return executable('pep257')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" sanity: kill empty lines here rather than munging errorformat
|
||||||
|
function! SyntaxCheckers_python_pep257_Preprocess(errors)
|
||||||
|
return filter(copy(a:errors), 'v:val != ""')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! SyntaxCheckers_python_pep257_GetLocList()
|
||||||
|
let makeprg = syntastic#makeprg#build({
|
||||||
|
\ 'exe': 'pep257',
|
||||||
|
\ 'filetype': 'python',
|
||||||
|
\ 'subchecker': 'pep257' })
|
||||||
|
|
||||||
|
let errorformat =
|
||||||
|
\ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' .
|
||||||
|
\ '%E%f:%l:%c: %m,' .
|
||||||
|
\ '%+C %m'
|
||||||
|
|
||||||
|
let loclist = SyntasticMake({
|
||||||
|
\ 'makeprg': makeprg,
|
||||||
|
\ 'errorformat': errorformat,
|
||||||
|
\ 'subtype': 'Style',
|
||||||
|
\ 'preprocess': 'SyntaxCheckers_python_pep257_Preprocess',
|
||||||
|
\ 'postprocess': ['compressWhitespace'] })
|
||||||
|
|
||||||
|
" pep257 outputs byte offsets rather than column numbers
|
||||||
|
for n in range(len(loclist))
|
||||||
|
let loclist[n]['col'] = get(loclist[n], 'col', 0) + 1
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return loclist
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
|
\ 'filetype': 'python',
|
||||||
|
\ 'name': 'pep257'})
|
@ -1,6 +1,6 @@
|
|||||||
"============================================================================
|
"============================================================================
|
||||||
"File: typescript.vim
|
"File: typescript.vim
|
||||||
"Description: TypeScript syntax checker. For TypeScript v0.8.0
|
"Description: TypeScript syntax checker
|
||||||
"Maintainer: Bill Casarin <bill@casarin.ca>
|
"Maintainer: Bill Casarin <bill@casarin.ca>
|
||||||
"============================================================================
|
"============================================================================
|
||||||
|
|
||||||
@ -17,15 +17,22 @@ endfunction
|
|||||||
function! SyntaxCheckers_typescript_tsc_GetLocList()
|
function! SyntaxCheckers_typescript_tsc_GetLocList()
|
||||||
let makeprg = syntastic#makeprg#build({
|
let makeprg = syntastic#makeprg#build({
|
||||||
\ 'exe': 'tsc',
|
\ 'exe': 'tsc',
|
||||||
|
\ 'args': '--module commonjs',
|
||||||
\ 'post_args': '--out ' . syntastic#util#DevNull(),
|
\ 'post_args': '--out ' . syntastic#util#DevNull(),
|
||||||
\ 'filetype': 'typescript',
|
\ 'filetype': 'typescript',
|
||||||
\ 'subchecker': 'tsc' })
|
\ 'subchecker': 'tsc' })
|
||||||
|
|
||||||
let errorformat = '%f %#(%l\,%c): %m'
|
let errorformat =
|
||||||
|
\ '%E%f %#(%l\,%c): error %m,' .
|
||||||
|
\ '%E%f %#(%l\,%c): %m,' .
|
||||||
|
\ '%Eerror %m,' .
|
||||||
|
\ '%C%\s%\+%m'
|
||||||
|
|
||||||
return SyntasticMake({
|
return SyntasticMake({
|
||||||
\ 'makeprg': makeprg,
|
\ 'makeprg': makeprg,
|
||||||
\ 'errorformat': errorformat })
|
\ 'errorformat': errorformat,
|
||||||
|
\ 'defaults': {'bufnr': bufnr("")},
|
||||||
|
\ 'postprocess': ['sort'] })
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
|
Loading…
Reference in New Issue
Block a user