Adds an option g:syntastic_ignore_files.
List of regexps specifying files that should neither be checked, nor included in error lists. The full paths of files are matched against these regexps, and the matches are case sensitive.
This commit is contained in:
parent
68cfe6513b
commit
8d47df65d2
@ -254,6 +254,15 @@ opens. >
|
|||||||
let g:syntastic_loc_list_height=5
|
let g:syntastic_loc_list_height=5
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*'syntastic_ignore_files'*
|
||||||
|
Default: []
|
||||||
|
Use this option to specify files that syntastic should neither check, nor
|
||||||
|
include in error lists. It has to be a list of |regular-expression| patterns.
|
||||||
|
The full paths of files (see |::p|) are matched against these patterns, and
|
||||||
|
the matches are case sensitive. Use |\c| if you need case insensitive
|
||||||
|
patterns. >
|
||||||
|
let g:syntastic_ignore_files=['^/usr/include/', '\c\.h$']
|
||||||
|
<
|
||||||
|
|
||||||
*'syntastic_mode_map'*
|
*'syntastic_mode_map'*
|
||||||
Default: { "mode": "active",
|
Default: { "mode": "active",
|
||||||
|
@ -48,6 +48,10 @@ if !exists("g:syntastic_loc_list_height")
|
|||||||
let g:syntastic_loc_list_height = 10
|
let g:syntastic_loc_list_height = 10
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("g:syntastic_ignore_files")
|
||||||
|
let g:syntastic_ignore_files = []
|
||||||
|
endif
|
||||||
|
|
||||||
let s:registry = g:SyntasticRegistry.Instance()
|
let s:registry = g:SyntasticRegistry.Instance()
|
||||||
let s:notifiers = g:SyntasticNotifiers.New()
|
let s:notifiers = g:SyntasticNotifiers.New()
|
||||||
let s:modemap = g:SyntasticModeMap.Instance()
|
let s:modemap = g:SyntasticModeMap.Instance()
|
||||||
@ -215,10 +219,21 @@ function! s:Redraw()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:IgnoreFile(filename)
|
||||||
|
let fname = fnamemodify(a:filename, ':p')
|
||||||
|
for p in g:syntastic_ignore_files
|
||||||
|
if fname =~# p
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Skip running in special buffers
|
" Skip running in special buffers
|
||||||
function! s:SkipFile()
|
function! s:SkipFile()
|
||||||
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
|
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
|
||||||
return force_skip || !empty(&buftype) || !filereadable(expand('%')) || getwinvar(0, '&diff')
|
let fname = expand('%')
|
||||||
|
return force_skip || !empty(&buftype) || !filereadable(fname) || getwinvar(0, '&diff') || s:IgnoreFile(fname)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:uname()
|
function! s:uname()
|
||||||
@ -329,6 +344,9 @@ function! SyntasticMake(options)
|
|||||||
call SyntasticAddToErrors(errors, a:options['defaults'])
|
call SyntasticAddToErrors(errors, a:options['defaults'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Apply ignore patterns
|
||||||
|
call filter(errors, '!s:IgnoreFile(bufname(str2nr(v:val["bufnr"])))')
|
||||||
|
|
||||||
" Add subtype info if present.
|
" Add subtype info if present.
|
||||||
if has_key(a:options, 'subtype')
|
if has_key(a:options, 'subtype')
|
||||||
call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']})
|
call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']})
|
||||||
|
Loading…
Reference in New Issue
Block a user