mirror of
https://github.com/amix/vimrc
synced 2025-07-09 10:36:29 +08:00
merge to origin
This commit is contained in:
@ -28,7 +28,9 @@ endfunction
|
||||
function! SyntaxCheckers_ansible_ansible_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-p' })
|
||||
|
||||
let errorformat = '%f:%l: [ANSIBLE%n] %m'
|
||||
let errorformat =
|
||||
\ '%f:%l: [EANSIBLE%n] %m,' .
|
||||
\ '%f:%l: [ANSIBLE%n] %m'
|
||||
|
||||
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
|
||||
|
||||
|
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_check_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check',
|
||||
\ 'redirect': 'c/clang_check'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_tidy_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy',
|
||||
\ 'redirect': 'c/clang_tidy'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -18,7 +18,6 @@ let g:loaded_syntastic_cpp_pc_lint_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt',
|
||||
\ 'redirect': 'c/pc_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -10,19 +10,41 @@ if exists('g:loaded_syntastic_cuda_nvcc_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_cuda_nvcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cuda_config_file')
|
||||
let g:syntastic_cuda_config_file = '.syntastic_cuda_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
||||
if syntastic#util#var('cuda_arch') !=# ''
|
||||
let arch_flag = '-arch=' . g:syntastic_cuda_arch
|
||||
else
|
||||
let arch_flag = ''
|
||||
let arch_flag = syntastic#util#var('cuda_arch')
|
||||
if arch_flag !=# ''
|
||||
let arch_flag = '-arch=' . arch_flag
|
||||
call syntastic#log#oneTimeWarn('variable g:syntastic_cuda_arch is deprecated, ' .
|
||||
\ 'please add ' . string(arch_flag) . ' to g:syntastic_cuda_nvcc_args instead')
|
||||
endif
|
||||
let makeprg =
|
||||
\ self.getExecEscaped() . ' ' . arch_flag .
|
||||
\ ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' .
|
||||
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput()
|
||||
|
||||
let build_opts = {}
|
||||
let dummy = ''
|
||||
if index(['h', 'hpp', 'cuh'], expand('%:e', 1), 0, 1) >= 0
|
||||
if syntastic#util#var('cuda_check_header', 0)
|
||||
let dummy = expand('%:p:h', 1) . syntastic#util#Slash() . '.syntastic_dummy.cu'
|
||||
let build_opts = {
|
||||
\ 'exe_before': 'echo > ' . syntastic#util#shescape(dummy) . ' ;',
|
||||
\ 'fname_before': '.syntastic_dummy.cu -include' }
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
call extend(build_opts, {
|
||||
\ 'args_before': arch_flag . ' --cuda -O0 -I .',
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_cuda_config_file),
|
||||
\ 'args_after': '-Xcompiler -fsyntax-only',
|
||||
\ 'tail_after': syntastic#c#NullOutput() })
|
||||
|
||||
let makeprg = self.makeprgBuild(build_opts)
|
||||
|
||||
let errorformat =
|
||||
\ '%*[^"]"%f"%*\D%l: %m,'.
|
||||
@ -40,19 +62,13 @@ function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
||||
\ '%DMaking %*\a in %f,'.
|
||||
\ '%f|%l| %m'
|
||||
|
||||
if index(['h', 'hpp', 'cuh'], expand('%:e', 1), 0, 1) >= 0
|
||||
if syntastic#util#var('cuda_check_header', 0)
|
||||
let makeprg =
|
||||
\ 'echo > .syntastic_dummy.cu ; ' .
|
||||
\ self.getExecEscaped() . ' ' . arch_flag .
|
||||
\ ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' .
|
||||
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput()
|
||||
else
|
||||
return []
|
||||
endif
|
||||
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
||||
if dummy !=# ''
|
||||
call delete(dummy)
|
||||
endif
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
23
sources_non_forked/syntastic/syntax_checkers/html/eslint.vim
Normal file
23
sources_non_forked/syntastic/syntax_checkers/html/eslint.vim
Normal file
@ -0,0 +1,23 @@
|
||||
"============================================================================
|
||||
"File: eslint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"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_html_eslint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_eslint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'eslint',
|
||||
\ 'redirect': 'javascript/eslint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,53 @@
|
||||
"============================================================================
|
||||
"File: tern_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047@gmail.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_javascript_tern_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_tern_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_IsAvailable() dict
|
||||
return has('byte_offset') && executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%n:%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'tern_lint',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
|
||||
endif
|
||||
let e['nr'] = 0
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'tern_lint',
|
||||
\ 'exec': 'tern-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -42,7 +42,8 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'racket',
|
||||
\ 'name': 'racket'})
|
||||
\ 'name': 'racket',
|
||||
\ 'enable': 'enable_racket_racket_checker' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"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_sass_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sass_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-v',
|
||||
\ 'args_after': '-q -f compact' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f: line %l\, col %c\, %trror - %m,' .
|
||||
\ '%f: line %l\, col %c\, %tarning - %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sass',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'exec': 'sass-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,23 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"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_scss_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scss_sass_lint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scss',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'redirect': 'sass/sass_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -41,35 +41,37 @@ endfunction " }}}1
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetValaModules() " {{{2
|
||||
if exists('g:syntastic_vala_modules')
|
||||
if type(g:syntastic_vala_modules) == type('')
|
||||
return split(g:syntastic_vala_modules, '\s\+')
|
||||
elseif type(g:syntastic_vala_modules) == type([])
|
||||
return copy(g:syntastic_vala_modules)
|
||||
if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules')
|
||||
let modules = syntastic#util#var('vala_modules')
|
||||
if type(modules) == type('')
|
||||
return split(modules, '\m\s\+')
|
||||
elseif type(modules) == type([])
|
||||
return copy(modules)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let modules_line = search('^// modules: ', 'n')
|
||||
let modules_str = getline(modules_line)
|
||||
return split(strpart(modules_str, 12), '\s\+')
|
||||
return split(strpart(modules_str, 12), '\m\s\+')
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetValaVapiDirs() " {{{2
|
||||
if exists('g:syntastic_vala_vapi_dirs')
|
||||
if type(g:syntastic_vala_vapi_dirs) == type('')
|
||||
return split(g:syntastic_vala_vapi_dirs, '\s\+')
|
||||
elseif type(g:syntastic_vala_vapi_dirs) == type([])
|
||||
return copy(g:syntastic_vala_vapi_dirs)
|
||||
if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs')
|
||||
let vapi_dirs = syntastic#util#var('vala_vapi_dirs')
|
||||
if type(vapi_dirs) == type('')
|
||||
return split(vapi_dirs, '\m\s\+')
|
||||
elseif type(vapi_dirs) == type([])
|
||||
return copy(vapi_dirs)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let vapi_line = search('^//\s*vapidirs:\s*','n')
|
||||
let vapi_str = getline(vapi_line)
|
||||
return split( substitute( vapi_str, '^//\s*vapidirs:\s*', '', 'g' ), '\s\+' )
|
||||
return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' )
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
@ -67,9 +67,10 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1
|
||||
\ 'EVL204': 3,
|
||||
\ 'EVL205': 3 }
|
||||
|
||||
if exists('g:syntastic_vimlint_options')
|
||||
if type(g:syntastic_vimlint_options) == type({})
|
||||
let options = filter(copy(g:syntastic_vimlint_options), 'v:key =~# "\\m^EVL"')
|
||||
if exists('g:syntastic_vimlint_options') || exists('b:syntastic_vimlint_options')
|
||||
let opts = syntastic#util#var('vimlint_options')
|
||||
if type(opts) == type({})
|
||||
let options = filter(copy(opts), 'v:key =~# "\\m^EVL"')
|
||||
call extend(param, options, 'force')
|
||||
endif
|
||||
endif
|
||||
|
Reference in New Issue
Block a user