mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated vimrc
This commit is contained in:
@ -37,7 +37,7 @@ function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
|
||||
|
||||
endif
|
||||
|
||||
return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
|
||||
|
@ -32,8 +32,8 @@ function! SyntaxCheckers_ada_gcc_GetLocList() dict
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %m',
|
||||
\ 'main_flags': '-c -x ada -fsyntax-only',
|
||||
\ 'header_flags': '-x ada',
|
||||
\ 'main_flags': '-c -x ada -gnats',
|
||||
\ 'header_flags': '-x ada -gnats',
|
||||
\ 'header_names': '\.ads$' })
|
||||
endfunction
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_apiblueprint_snowcrash_checker")
|
||||
if exists('g:loaded_syntastic_apiblueprint_snowcrash_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_apiblueprint_snowcrash_checker = 1
|
||||
|
@ -25,7 +25,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_applescript_osacompile_checker")
|
||||
if exists('g:loaded_syntastic_applescript_osacompile_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_applescript_osacompile_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_asciidoc_asciidoc_checker")
|
||||
if exists('g:loaded_syntastic_asciidoc_asciidoc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_asciidoc_asciidoc_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_bemhtml_bemhtmllint_checker")
|
||||
if exists('g:loaded_syntastic_bemhtml_bemhtmllint_checker')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_bro_bro_checker")
|
||||
if exists('g:loaded_syntastic_bro_bro_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_bro_bro_checker = 1
|
||||
@ -20,7 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_bro_bro_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m at or near "\zs[^"]\+\ze"')
|
||||
return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_bro_bro_IsAvailable() dict
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_checkpatch_checker")
|
||||
if exists('g:loaded_syntastic_c_checkpatch_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_checkpatch_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_clang_check_checker")
|
||||
if exists('g:loaded_syntastic_c_clang_check_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_check_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_clang_tidy_checker")
|
||||
if exists('g:loaded_syntastic_c_clang_tidy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_tidy_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_cppcheck_checker")
|
||||
if exists('g:loaded_syntastic_c_cppcheck_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_cppcheck_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_oclint_checker")
|
||||
if exists('g:loaded_syntastic_c_oclint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_oclint_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_pc_lint_checker")
|
||||
if exists('g:loaded_syntastic_c_pc_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_pc_lint_checker = 1
|
||||
@ -23,7 +23,7 @@ if !exists('g:syntastic_pc_lint_config_file')
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_pc_lint_GetLocList() dict
|
||||
let config = findfile(g:syntastic_pc_lint_config_file, '.;')
|
||||
let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, expand('%:p:h', 1))
|
||||
call self.log('config =', config)
|
||||
|
||||
" -hFs1 - show filename, add space after messages, try to make message 1 line
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_sparse_checker")
|
||||
if exists('g:loaded_syntastic_c_sparse_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_sparse_checker = 1
|
||||
@ -33,7 +33,7 @@ function! SyntaxCheckers_c_sparse_GetLocList() dict
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
return loclist
|
||||
endfunction
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_splint_checker")
|
||||
if exists('g:loaded_syntastic_c_splint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_splint_checker = 1
|
||||
|
@ -20,11 +20,11 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item)
|
||||
let field = matchstr(a:item['text'], "\\vParse of field '\\zs[^']+")
|
||||
if field != ''
|
||||
if field !=# ''
|
||||
return '\v\c^\s*' . field . '\s*:\s*\zs.*$'
|
||||
endif
|
||||
let field = matchstr(a:item['text'], "\\v(^|\\s)'\\zs[^']+\\ze'")
|
||||
if field != ''
|
||||
if field !=# ''
|
||||
return '\V\c\<' . escape(field, '\') . '\>'
|
||||
endif
|
||||
return ''
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_chef_foodcritic_checker")
|
||||
if exists('g:loaded_syntastic_chef_foodcritic_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_chef_foodcritic_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_co_coco_checker")
|
||||
if exists('g:loaded_syntastic_co_coco_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_co_coco_checker = 1
|
||||
|
@ -13,7 +13,7 @@
|
||||
" Note: this script requires CoffeeScript version 1.6.2 or newer.
|
||||
"
|
||||
|
||||
if exists("g:loaded_syntastic_coffee_coffee_checker")
|
||||
if exists('g:loaded_syntastic_coffee_coffee_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffee_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_coffee_coffeelint_checker")
|
||||
if exists('g:loaded_syntastic_coffee_coffeelint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffeelint_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_coq_coqtop_checker")
|
||||
if exists('g:loaded_syntastic_coq_coqtop_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coq_coqtop_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_clang_check_checker")
|
||||
if exists('g:loaded_syntastic_cpp_clang_check_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_clang_check_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_clang_tidy_checker")
|
||||
if exists('g:loaded_syntastic_cpp_clang_tidy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_clang_tidy_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_cppcheck_checker")
|
||||
if exists('g:loaded_syntastic_cpp_cppcheck_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_cppcheck_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_cpplint_checker")
|
||||
if exists('g:loaded_syntastic_cpp_cpplint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_cpplint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_oclint_checker")
|
||||
if exists('g:loaded_syntastic_cpp_oclint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_oclint_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_pc_lint_checker")
|
||||
if exists('g:loaded_syntastic_cpp_pc_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_pc_lint_checker = 1
|
||||
|
48
sources_non_forked/syntastic/syntax_checkers/cpp/verapp.vim
Normal file
48
sources_non_forked/syntastic/syntax_checkers/cpp/verapp.vim
Normal file
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: verapp.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Lucas Verney <phyks@phyks.me>
|
||||
"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.
|
||||
"
|
||||
" Tested with Vera++ 1.3.0
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_cpp_verapp_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_verapp_checker = 1
|
||||
|
||||
if !exists('g:syntastic_verapp_config_file')
|
||||
let g:syntastic_verapp_config_file = '.syntastic_verapp_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cpp_verapp_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_verapp_config_file),
|
||||
\ 'args_after': '--show-rule --no-duplicate -S -c -' })
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'checkstyle',
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'verapp',
|
||||
\ 'exec': 'vera++'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cs_mcs_checker")
|
||||
if exists('g:loaded_syntastic_cs_mcs_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cs_mcs_checker = 1
|
||||
@ -26,7 +26,7 @@ function! SyntaxCheckers_cs_mcs_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -33,7 +33,7 @@ function! SyntaxCheckers_css_csslint_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
|
||||
endfunction
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_css_phpcs_checker")
|
||||
if exists('g:loaded_syntastic_css_phpcs_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_phpcs_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_css_prettycss_checker")
|
||||
if exists('g:loaded_syntastic_css_prettycss_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_prettycss_checker = 1
|
||||
@ -23,8 +23,8 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item["text"], '\m (\zs[^)]\+\ze)$')
|
||||
if term != ''
|
||||
let term = matchstr(a:item['text'], '\m (\zs[^)]\+\ze)$')
|
||||
if term !=# ''
|
||||
let term = '\V' . escape(term, '\')
|
||||
endif
|
||||
return term
|
||||
@ -42,10 +42,10 @@ function! SyntaxCheckers_css_prettycss_GetLocList() dict
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
|
||||
for e in loclist
|
||||
let e["text"] .= ')'
|
||||
let e['text'] .= ')'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
|
@ -11,7 +11,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_css_recess_checker")
|
||||
if exists('g:loaded_syntastic_css_recess_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_recess_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cucumber_cucumber_checker")
|
||||
if exists('g:loaded_syntastic_cucumber_cucumber_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cucumber_cucumber_checker = 1
|
||||
|
@ -6,7 +6,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cuda_nvcc_checker")
|
||||
if exists('g:loaded_syntastic_cuda_nvcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cuda_nvcc_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_dart_dartanalyzer_checker")
|
||||
if exists('g:loaded_syntastic_dart_dartanalyzer_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_dart_dartanalyzer_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_docbk_xmllint_checker")
|
||||
if exists('g:loaded_syntastic_docbk_xmllint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_docbk_xmllint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_dustjs_swiffer_checker")
|
||||
if exists('g:loaded_syntastic_dustjs_swiffer_checker')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_elixir_elixir_checker")
|
||||
if exists('g:loaded_syntastic_elixir_elixir_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_elixir_elixir_checker = 1
|
||||
@ -27,15 +27,9 @@ function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_elixir_elixir_GetLocList() dict
|
||||
if !exists('g:syntastic_enable_elixir_checker') || !g:syntastic_enable_elixir_checker
|
||||
call syntastic#log#error('checker elixir/elixir: checks disabled for security reasons; ' .
|
||||
\ 'set g:syntastic_enable_elixir_checker to 1 to override')
|
||||
return []
|
||||
endif
|
||||
|
||||
let make_options = {}
|
||||
let compile_command = 'elixir'
|
||||
let mix_file = syntastic#util#findInParent('mix.exs', expand('%:p:h', 1))
|
||||
let mix_file = syntastic#util#findFileInParent('mix.exs', expand('%:p:h', 1))
|
||||
|
||||
if filereadable(mix_file)
|
||||
let compile_command = 'mix compile'
|
||||
@ -53,7 +47,8 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'elixir',
|
||||
\ 'name': 'elixir'})
|
||||
\ 'name': 'elixir',
|
||||
\ 'enable': 'enable_elixir_checker'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
@ -1,56 +1,73 @@
|
||||
#!/usr/bin/env escript
|
||||
-export([main/1]).
|
||||
|
||||
main([FileName]) ->
|
||||
LibDirs = (["ebin", "include", "src", "test"] ++
|
||||
filelib:wildcard("{apps,deps,lib}/*/{ebin,include}")),
|
||||
compile(FileName, LibDirs);
|
||||
main([File]) ->
|
||||
Dir = get_root(filename:dirname(File)),
|
||||
Defs = [strong_validation,
|
||||
warn_export_all,
|
||||
warn_export_vars,
|
||||
warn_shadow_vars,
|
||||
warn_obsolete_guard,
|
||||
warn_unused_import,
|
||||
report,
|
||||
{i, Dir ++ "/include"}],
|
||||
%% `rebar.config` is looked for,
|
||||
%% but it is not necessarily the one in the project root.
|
||||
%% I.e. it may be one deeper in the project file hierarchy.
|
||||
RebarFile = rebar_file(Dir),
|
||||
%% `rebar.config` might contain relative paths.
|
||||
%% They are relative to the file! Not to the project root.
|
||||
RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile),
|
||||
code:add_patha(filename:absname("ebin")),
|
||||
%% `compile:file/2` requires the `{i, Path}` to be relative
|
||||
%% to CWD - no surprise here.
|
||||
compile:file(File, Defs ++ translate_paths(Dir, RebarOpts));
|
||||
|
||||
main([FileName, "-rebar", Path, LibDirs]) ->
|
||||
{ok, L} = file:consult(Path),
|
||||
P = dict:from_list(L),
|
||||
Root = filename:dirname(Path),
|
||||
main(_) ->
|
||||
io:format("Usage: ~s <file>~n", [escript:script_name()]),
|
||||
halt(1).
|
||||
|
||||
Lib1 = case dict:find(lib_dirs, P) of
|
||||
{ok, X} -> lists:map(fun(Sub) -> Root ++ "/" ++ Sub end, X);
|
||||
_ -> []
|
||||
end,
|
||||
rebar_file(Dir) ->
|
||||
DirList = filename:split(Dir),
|
||||
case lists:last(DirList) of
|
||||
"test" ->
|
||||
"rebar.test.config";
|
||||
_ ->
|
||||
"rebar.config"
|
||||
end.
|
||||
|
||||
Lib2 = case dict:find(sub_dirs, P) of
|
||||
{ok, Y} -> lists:foldl(
|
||||
fun(Sub,Sofar) ->
|
||||
Sofar ++ [
|
||||
Root ++ "/" ++ Sub,
|
||||
Root ++ "/" ++ Sub ++ "/include",
|
||||
Root ++ "/" ++ Sub ++ "/deps",
|
||||
Root ++ "/" ++ Sub ++ "/lib"
|
||||
] end, [], Y);
|
||||
_ -> []
|
||||
end,
|
||||
rebar_opts(RebarFile) ->
|
||||
Dir = get_root(filename:dirname(RebarFile)),
|
||||
case file:consult(RebarFile) of
|
||||
{ok, Terms} ->
|
||||
RebarLibDirs = proplists:get_value(lib_dirs, Terms, []),
|
||||
lists:foreach(
|
||||
fun(LibDir) ->
|
||||
code:add_pathsa(filelib:wildcard(LibDir ++ "/*/ebin"))
|
||||
end, RebarLibDirs),
|
||||
RebarDepsDir = proplists:get_value(deps_dir, Terms, "deps"),
|
||||
code:add_pathsa(filelib:wildcard(RebarDepsDir ++ "/*/ebin")),
|
||||
IncludeDeps = {i, filename:join(Dir, RebarDepsDir)},
|
||||
proplists:get_value(erl_opts, Terms, []) ++ [IncludeDeps];
|
||||
{error, _} when RebarFile == "rebar.config" ->
|
||||
fallback_opts();
|
||||
{error, _} ->
|
||||
rebar_opts("rebar.config")
|
||||
end.
|
||||
|
||||
LibDirs1 = LibDirs ++ Lib1 ++ Lib2,
|
||||
%io:format("~p~n", [LibDirs1]),
|
||||
compile(FileName, LibDirs1);
|
||||
fallback_opts() ->
|
||||
code:add_pathsa(filelib:wildcard("deps/*/ebin")),
|
||||
code:add_pathsa(nested_app_ebins()),
|
||||
[
|
||||
{ i, filename:absname("apps") }, { i, filename:absname("deps") } | [ { i, filename:absname(Path) } || Path <- filelib:wildcard("deps/*/apps")]
|
||||
].
|
||||
|
||||
main([FileName | LibDirs]) ->
|
||||
compile(FileName, LibDirs).
|
||||
nested_app_ebins() ->
|
||||
DetectedAppSrcFiles = filelib:wildcard("deps/*/apps/**/*.app.src"),
|
||||
[apps_dir_from_src(AppSrcFile)||AppSrcFile<-DetectedAppSrcFiles].
|
||||
|
||||
compile(FileName, LibDirs) ->
|
||||
Root = get_root(filename:dirname(FileName)),
|
||||
ok = code:add_pathsa(LibDirs),
|
||||
compile:file(FileName,
|
||||
[warn_obsolete_guard,
|
||||
warn_unused_import,
|
||||
warn_shadow_vars,
|
||||
warn_export_vars,
|
||||
strong_validation,
|
||||
report] ++
|
||||
[{i, filename:join(Root, I)} || I <- LibDirs] ++
|
||||
case lists:member("deps/pmod_transform/include", LibDirs) of
|
||||
true -> [{parse_transform, pmod_pt}];
|
||||
_ -> []
|
||||
end
|
||||
).
|
||||
apps_dir_from_src(SrcFile) ->
|
||||
SrcDir = filename:dirname(SrcFile),
|
||||
filename:join(SrcDir, "../../ebin").
|
||||
|
||||
get_root(Dir) ->
|
||||
Path = filename:split(filename:absname(Dir)),
|
||||
@ -64,3 +81,15 @@ get_root(["test" | Tail], _Path) ->
|
||||
lists:reverse(Tail);
|
||||
get_root([_ | Tail], Path) ->
|
||||
get_root(Tail, Path).
|
||||
|
||||
translate_paths(Dir, RebarOpts) ->
|
||||
[ translate_path(Dir, Opt) || Opt <- RebarOpts ].
|
||||
|
||||
translate_path(Dir, {i, Path}) ->
|
||||
case Path of
|
||||
%% absolute
|
||||
"/" ++ _ -> {i, Path};
|
||||
%% relative -> make absolute taking rebar.config location into account
|
||||
_ -> {i, filename:join([Dir, Path])}
|
||||
end;
|
||||
translate_path(_, Other) -> Other.
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_erlang_syntaxerl_checker")
|
||||
if exists('g:loaded_syntastic_erlang_syntaxerl_checker')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_eruby_ruby_checker")
|
||||
if exists('g:loaded_syntastic_eruby_ruby_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_eruby_ruby_checker = 1
|
||||
@ -35,7 +35,7 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if s:ruby_new
|
||||
let enc = &fileencoding != '' ? &fileencoding : &encoding
|
||||
let enc = &fileencoding !=# '' ? &fileencoding : &encoding
|
||||
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
|
||||
else
|
||||
let encoding_spec = ''
|
||||
@ -69,7 +69,7 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': { 'bufnr': bufnr(""), 'vcol': 1 } })
|
||||
\ 'defaults': { 'bufnr': bufnr(''), 'vcol': 1 } })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -10,37 +10,84 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_fortran_gfortran_checker")
|
||||
if exists('g:loaded_syntastic_fortran_gfortran_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_fortran_gfortran_checker=1
|
||||
let g:loaded_syntastic_fortran_gfortran_checker = 1
|
||||
|
||||
if !exists('g:syntastic_fortran_compiler_options')
|
||||
let g:syntastic_fortran_compiler_options = ''
|
||||
endif
|
||||
|
||||
let s:type_map = {}
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict
|
||||
function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict " {{{1
|
||||
if !exists('g:syntastic_fortran_compiler')
|
||||
let g:syntastic_fortran_compiler = self.getExec()
|
||||
endif
|
||||
call self.log('g:syntastic_fortran_compiler = ', g:syntastic_fortran_compiler)
|
||||
return executable(expand(g:syntastic_fortran_compiler, 1))
|
||||
endfunction
|
||||
endfunction " }}}1
|
||||
|
||||
" @vimlint(EVL104, 1, l:errorformat)
|
||||
function! SyntaxCheckers_fortran_gfortran_GetLocList() dict " {{{1
|
||||
call s:SetCompilerType(g:syntastic_fortran_compiler)
|
||||
if !has_key(s:type_map, g:syntastic_fortran_compiler)
|
||||
call syntastic#log#error("checker fortran/gfortran: can't parse version string (abnormal termination?)")
|
||||
return []
|
||||
endif
|
||||
|
||||
if s:type_map[g:syntastic_fortran_compiler] ==# 'gfortran'
|
||||
let errorformat =
|
||||
\ '%-C %#,'.
|
||||
\ '%-C %#%.%#,'.
|
||||
\ '%A%f:%l%[.:]%c:,'.
|
||||
\ '%Z%\m%\%%(Fatal %\)%\?%trror: %m,'.
|
||||
\ '%Z%tarning: %m,'.
|
||||
\ '%-G%.%#'
|
||||
if !exists('g:syntastic_fortran_gfortran_sort')
|
||||
let g:syntastic_fortran_gfortran_sort = 0
|
||||
endif
|
||||
elseif s:type_map[g:syntastic_fortran_compiler] ==# 'ifort'
|
||||
let errorformat =
|
||||
\ '%E%f(%l): error #%n: %m,'.
|
||||
\ '%W%f(%l): warning #%n: %m,'.
|
||||
\ '%W%f(%l): remark #%n: %m,'.
|
||||
\ '%-Z%p^,'.
|
||||
\ '%-G%.%#'
|
||||
if !exists('g:syntastic_fortran_gfortran_sort')
|
||||
let g:syntastic_fortran_gfortran_sort = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_fortran_gfortran_GetLocList() dict
|
||||
return syntastic#c#GetLocList('fortran', 'gfortran', {
|
||||
\ 'errorformat':
|
||||
\ '%-C %#,'.
|
||||
\ '%-C %#%.%#,'.
|
||||
\ '%A%f:%l.%c:,'.
|
||||
\ '%Z%trror: %m,'.
|
||||
\ '%Z%tarning: %m,'.
|
||||
\ '%-G%.%#',
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'main_flags': '-fsyntax-only' })
|
||||
endfunction
|
||||
endfunction " }}}1
|
||||
" @vimlint(EVL104, 0, l:errorformat)
|
||||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:SetCompilerType(exe) " {{{2
|
||||
if !has_key(s:type_map, a:exe)
|
||||
try
|
||||
let ver = filter( split(syntastic#util#system(syntastic#util#shescape(a:exe) . ' --version'), '\n'),
|
||||
\ 'v:val =~# "\\v^%(GNU Fortran|ifort) "' )[0]
|
||||
if ver =~# '\m^GNU Fortran '
|
||||
let s:type_map[a:exe] = 'gfortran'
|
||||
elseif ver =~# '\m^ifort '
|
||||
let s:type_map[a:exe] = 'ifort'
|
||||
endif
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
" do nothing
|
||||
endtry
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'fortran',
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_glsl_cgc_checker")
|
||||
if exists('g:loaded_syntastic_glsl_cgc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_glsl_cgc_checker = 1
|
||||
@ -33,8 +33,8 @@ function! SyntaxCheckers_glsl_cgc_GetLocList() dict " {{{1
|
||||
\ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') })
|
||||
|
||||
let errorformat =
|
||||
\ "%E%f(%l) : error %m," .
|
||||
\ "%W%f(%l) : warning %m"
|
||||
\ '%E%f(%l) : error %m,' .
|
||||
\ '%W%f(%l) : warning %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
@ -14,7 +14,7 @@
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
|
||||
if exists("g:loaded_syntastic_go_go_checker")
|
||||
if exists('g:loaded_syntastic_go_go_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_go_checker = 1
|
||||
@ -58,8 +58,8 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
let opts = syntastic#util#var('go_go_test_args')
|
||||
let cleanup = 1
|
||||
endif
|
||||
let opt_str = (type(opts) != type('') || opts != '') ? join(syntastic#util#argsescape(opts)) : opts
|
||||
let makeprg = self.getExec() . ' ' . cmd . ' ' . opt_str . ' ' . syntastic#c#NullOutput()
|
||||
let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts
|
||||
let makeprg = self.getExec() . ' ' . cmd . ' ' . opt_str
|
||||
|
||||
" The first pattern is for warnings from C compilers.
|
||||
let errorformat =
|
||||
|
@ -14,7 +14,7 @@
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
|
||||
if exists("g:loaded_syntastic_go_gofmt_checker")
|
||||
if exists('g:loaded_syntastic_go_gofmt_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_gofmt_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_go_golint_checker")
|
||||
if exists('g:loaded_syntastic_go_golint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_golint_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_go_gotype_checker")
|
||||
if exists('g:loaded_syntastic_go_gotype_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_gotype_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_go_govet_checker")
|
||||
if exists('g:loaded_syntastic_go_govet_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_govet_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haml_haml_lint_checker")
|
||||
if exists('g:loaded_syntastic_haml_haml_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haml_haml_lint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_handlebars_handlebars_checker")
|
||||
if exists('g:loaded_syntastic_handlebars_handlebars_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_handlebars_handlebars_checker = 1
|
||||
@ -21,8 +21,8 @@ function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-f ' . syntastic#util#DevNull() })
|
||||
|
||||
let errorformat =
|
||||
\ '%EError: %m on line %l:,'.
|
||||
\ "%EError: %m,".
|
||||
\ '%EError: %m on line %l:,' .
|
||||
\ '%EError: %m,' .
|
||||
\ '%Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
@ -30,7 +30,7 @@ function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['guards'],
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -30,20 +30,23 @@ function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict
|
||||
" know the version in order to know how to find out the version. :)
|
||||
|
||||
" Try "ghc-mod version".
|
||||
let ver = filter(split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1)
|
||||
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
|
||||
if !len(ver)
|
||||
" That didn't work. Try "ghc-mod" alone.
|
||||
let ver = filter(split(syntastic#util#system(self.getExecEscaped()), '\n'), 'v:val =~# ''\m\sversion''')
|
||||
let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1)
|
||||
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
|
||||
endif
|
||||
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : []
|
||||
|
||||
if len(ver)
|
||||
if len(parsed_ver)
|
||||
" Encouraged by the great success in finding out the version, now we
|
||||
" need either a Vim that can handle NULs in system() output, or a
|
||||
" ghc-mod that has the "--boundary" option.
|
||||
let parsed_ver = syntastic#util#parseVersion(ver[0])
|
||||
call self.setVersion(parsed_ver)
|
||||
let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
|
||||
else
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
|
||||
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
|
||||
let s:ghc_mod_new = -1
|
||||
endif
|
||||
@ -68,6 +71,7 @@ function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'iconv',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'returns': [0] })
|
||||
endfunction
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haskell_hdevtools_checker")
|
||||
if exists('g:loaded_syntastic_haskell_hdevtools_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hdevtools_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haxe_haxe_checker")
|
||||
if exists('g:loaded_syntastic_haxe_haxe_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haxe_haxe_checker = 1
|
||||
@ -24,13 +24,13 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
|
||||
elseif exists('g:vaxe_hxml')
|
||||
let hxml = g:vaxe_hxml
|
||||
else
|
||||
let hxml = syntastic#util#findInParent('*.hxml', expand('%:p:h', 1))
|
||||
let hxml = syntastic#util#findGlobInParent('*.hxml', expand('%:p:h', 1))
|
||||
endif
|
||||
let hxml = fnamemodify(hxml, ':p')
|
||||
|
||||
call self.log('hxml =', hxml)
|
||||
|
||||
if hxml != ''
|
||||
if hxml !=# ''
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')) })
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_hss_hss_checker")
|
||||
if exists('g:loaded_syntastic_hss_hss_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_hss_hss_checker = 1
|
||||
|
@ -9,16 +9,8 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("g:loaded_syntastic_html_tidy_checker")
|
||||
if exists('g:loaded_syntastic_html_tidy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_tidy_checker = 1
|
||||
@ -102,40 +94,40 @@ let s:IGNORE_ERRORS = [
|
||||
lockvar! s:IGNORE_ERRORS
|
||||
|
||||
let s:BLOCKLEVEL_TAGS = [
|
||||
\ "main",
|
||||
\ "section",
|
||||
\ "article",
|
||||
\ "aside",
|
||||
\ "header",
|
||||
\ "footer",
|
||||
\ "nav",
|
||||
\ "figure",
|
||||
\ "figcaption"
|
||||
\ 'main',
|
||||
\ 'section',
|
||||
\ 'article',
|
||||
\ 'aside',
|
||||
\ 'header',
|
||||
\ 'footer',
|
||||
\ 'nav',
|
||||
\ 'figure',
|
||||
\ 'figcaption'
|
||||
\ ]
|
||||
lockvar! s:BLOCKLEVEL_TAGS
|
||||
|
||||
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'
|
||||
\ ]
|
||||
lockvar! s:INLINE_TAGS
|
||||
|
||||
let s:EMPTY_TAGS = [
|
||||
\ "wbr",
|
||||
\ "keygen"
|
||||
\ 'wbr',
|
||||
\ 'keygen'
|
||||
\ ]
|
||||
lockvar! s:EMPTY_TAGS
|
||||
|
||||
@ -152,7 +144,7 @@ function! SyntaxCheckers_html_tidy_GetLocList() dict " {{{1
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1, 2] })
|
||||
|
||||
" filter out valid HTML5 from the errors
|
||||
|
@ -10,13 +10,13 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_html_validator_checker")
|
||||
if exists('g:loaded_syntastic_html_validator_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_validator_checker=1
|
||||
|
||||
if !exists('g:syntastic_html_validator_api')
|
||||
let g:syntastic_html_validator_api = 'http://validator.nu/'
|
||||
let g:syntastic_html_validator_api = 'https://validator.nu/'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_validator_parser')
|
||||
@ -32,9 +32,9 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_html_validator_GetLocList() dict
|
||||
let fname = syntastic#util#shexpand('%')
|
||||
let makeprg = self.getExecEscaped() . ' -q -s --compressed -F out=gnu -F asciiquotes=yes' .
|
||||
\ (g:syntastic_html_validator_parser != '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||
\ (g:syntastic_html_validator_nsfilter != '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
||||
let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F out=gnu -F asciiquotes=yes' .
|
||||
\ (g:syntastic_html_validator_parser !=# '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||
\ (g:syntastic_html_validator_nsfilter !=# '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
||||
\ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
|
||||
|
||||
let errorformat =
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_html_w3_checker")
|
||||
if exists('g:loaded_syntastic_html_w3_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_w3_checker = 1
|
||||
@ -23,7 +23,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_html_w3_GetLocList() dict
|
||||
let makeprg = self.getExecEscaped() . ' -q -s -F output=json ' .
|
||||
let makeprg = self.getExecEscaped() . ' -q -L -s -F output=json ' .
|
||||
\ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' .
|
||||
\ g:syntastic_html_w3_api
|
||||
|
||||
@ -41,7 +41,7 @@ function! SyntaxCheckers_html_w3_GetLocList() dict
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
|
@ -11,16 +11,16 @@
|
||||
" Tested with checkstyle 5.5
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_java_checkstyle_checker")
|
||||
if exists('g:loaded_syntastic_java_checkstyle_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_java_checkstyle_checker = 1
|
||||
|
||||
if !exists("g:syntastic_java_checkstyle_classpath")
|
||||
if !exists('g:syntastic_java_checkstyle_classpath')
|
||||
let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_checkstyle_conf_file")
|
||||
if !exists('g:syntastic_java_checkstyle_conf_file')
|
||||
let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
|
||||
endif
|
||||
|
||||
|
@ -73,6 +73,17 @@ endif
|
||||
|
||||
" }}}1
|
||||
|
||||
" Constants {{{1
|
||||
|
||||
let s:_FILE_SHORTCUTS = {
|
||||
\ '%FILE_PATH%': '%:p',
|
||||
\ '%FILE_NAME%': '%:t',
|
||||
\ '%FILE_DIR%': '%:p:h',
|
||||
\ }
|
||||
lockvar! s:_FILE_SHORTCUTS
|
||||
|
||||
" }}}1
|
||||
|
||||
command! SyntasticJavacEditClasspath call s:EditClasspath()
|
||||
|
||||
if g:syntastic_java_javac_config_file_enabled
|
||||
@ -103,7 +114,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
let javac_classpath = ''
|
||||
|
||||
for path in split(g:syntastic_java_javac_classpath, s:ClassSep())
|
||||
if path != ''
|
||||
if path !=# ''
|
||||
try
|
||||
let ps = glob(path, 1, 1)
|
||||
catch
|
||||
@ -128,8 +139,13 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
" }}}2
|
||||
|
||||
" load custom classpath {{{2
|
||||
if g:syntastic_java_javac_custom_classpath_command != ''
|
||||
let lines = syntastic#util#system(g:syntastic_java_javac_custom_classpath_command)
|
||||
if g:syntastic_java_javac_custom_classpath_command !=# ''
|
||||
" Pre-process the classpath command string a little.
|
||||
let classpath_command = g:syntastic_java_javac_custom_classpath_command
|
||||
for [key, val] in items(s:_FILE_SHORTCUTS)
|
||||
let classpath_command = substitute(classpath_command, '\V' . key, syntastic#util#shexpand(val), 'g')
|
||||
endfor
|
||||
let lines = syntastic#util#system(classpath_command)
|
||||
if syntastic#util#isRunningWindows() || has('win32unix')
|
||||
let lines = substitute(lines, "\r\n", "\n", 'g')
|
||||
endif
|
||||
@ -138,7 +154,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
endfor
|
||||
endif
|
||||
|
||||
if javac_classpath != ''
|
||||
if javac_classpath !=# ''
|
||||
let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath)
|
||||
endif
|
||||
" }}}2
|
||||
@ -162,7 +178,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
\ '%+C%.%#,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
if output_dir != ''
|
||||
if output_dir !=# ''
|
||||
silent! call mkdir(output_dir, 'p')
|
||||
endif
|
||||
let errors = SyntasticMake({
|
||||
@ -170,7 +186,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['cygwinRemoveCR'] })
|
||||
|
||||
if output_dir != ''
|
||||
if output_dir !=# ''
|
||||
call syntastic#util#rmrf(output_dir)
|
||||
endif
|
||||
return errors
|
||||
@ -188,10 +204,10 @@ function! s:ClassSep() " {{{2
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:AddToClasspath(classpath, path) " {{{2
|
||||
if a:path == ''
|
||||
if a:path ==# ''
|
||||
return a:classpath
|
||||
endif
|
||||
return (a:classpath != '') ? a:classpath . s:ClassSep() . a:path : a:path
|
||||
return (a:classpath !=# '') ? a:classpath . s:ClassSep() . a:path : a:path
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:SplitClasspath(classpath) " {{{2
|
||||
@ -299,7 +315,7 @@ endfunction " }}}2
|
||||
|
||||
function! s:GetMavenProperties() " {{{2
|
||||
let mvn_properties = {}
|
||||
let pom = findfile('pom.xml', '.;')
|
||||
let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
|
||||
if s:has_maven && filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
|
||||
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
|
||||
@ -334,7 +350,7 @@ function! s:GetMavenProperties() " {{{2
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetMavenClasspath() " {{{2
|
||||
let pom = findfile('pom.xml', '.;')
|
||||
let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
|
||||
if s:has_maven && filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
|
||||
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
|
||||
@ -378,7 +394,7 @@ function! s:GetMavenClasspath() " {{{2
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:MavenOutputDirectory() " {{{2
|
||||
let pom = findfile('pom.xml', '.;')
|
||||
let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
|
||||
if s:has_maven && filereadable(pom)
|
||||
let mvn_properties = s:GetMavenProperties()
|
||||
let output_dir = getcwd()
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_closurecompiler_checker")
|
||||
if exists('g:loaded_syntastic_javascript_closurecompiler_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_closurecompiler_checker = 1
|
||||
|
@ -21,9 +21,20 @@ endif
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_flow_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_flow_GetLocList() dict
|
||||
if syntastic#util#findFileInParent('.flowconfig', expand('%:p:h', 1)) ==# ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': self.getExecEscaped() . ' check',
|
||||
\ 'exe': self.getExecEscaped() . ' status',
|
||||
\ 'args_after': '--show-all-errors --json' })
|
||||
|
||||
let errorformat =
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_gjslint_checker")
|
||||
if exists('g:loaded_syntastic_javascript_gjslint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_gjslint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_jscs_checker")
|
||||
if exists('g:loaded_syntastic_javascript_jscs_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_jscs_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_jsl_checker")
|
||||
if exists('g:loaded_syntastic_javascript_jsl_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_jsl_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_jslint_checker")
|
||||
if exists('g:loaded_syntastic_javascript_jslint_checker')
|
||||
finish
|
||||
endif
|
||||
|
||||
@ -21,7 +21,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\mExpected .* and instead saw ''\zs.*\ze''')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
let term = '\V\<' . escape(term, '\') . '\>'
|
||||
endif
|
||||
return term
|
||||
@ -38,7 +38,7 @@ function! SyntaxCheckers_javascript_jslint_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -18,15 +18,16 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
|
||||
let jsxhint_version = syntastic#util#system(self.getExecEscaped() . ' --version')
|
||||
if v:shell_error || (jsxhint_version !~# '\m^JSXHint\>')
|
||||
return 0
|
||||
let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
|
||||
let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : []
|
||||
if len(parsed_ver)
|
||||
call self.setVersion(parsed_ver)
|
||||
else
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
|
||||
call syntastic#log#error("checker javascript/jsxhint: can't parse version string (abnormal termination?)")
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#parseVersion(jsxhint_version)
|
||||
call self.setVersion(ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 4, 1])
|
||||
return syntastic#util#versionIsAtLeast(parsed_ver, [0, 4, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_standard_checker")
|
||||
if exists('g:loaded_syntastic_javascript_standard_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_standard_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_json_jsonlint_checker")
|
||||
if exists('g:loaded_syntastic_json_jsonlint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonlint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_json_jsonval_checker")
|
||||
if exists('g:loaded_syntastic_json_jsonval_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonval_checker = 1
|
||||
|
@ -10,16 +10,16 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_less_lessc_checker")
|
||||
if exists('g:loaded_syntastic_less_lessc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_less_lessc_checker = 1
|
||||
|
||||
if !exists("g:syntastic_less_options")
|
||||
let g:syntastic_less_options = ""
|
||||
if !exists('g:syntastic_less_options')
|
||||
let g:syntastic_less_options = ''
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_less_use_less_lint")
|
||||
if !exists('g:syntastic_less_use_less_lint')
|
||||
let g:syntastic_less_use_less_lint = 0
|
||||
endif
|
||||
|
||||
@ -53,7 +53,7 @@ function! SyntaxCheckers_less_lessc_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['guards'],
|
||||
\ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })
|
||||
\ 'defaults': {'bufnr': bufnr(''), 'text': 'Syntax error'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_lex_flex_checker")
|
||||
if exists('g:loaded_syntastic_lex_flex_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lex_flex_checker = 1
|
||||
@ -21,12 +21,12 @@ set cpo&vim
|
||||
function! SyntaxCheckers_lex_flex_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'],
|
||||
\ '\m^\(unrecognized %option\|bad <start condition>\|bad character\( class expression\)\=\): \zs.*')
|
||||
if term == ''
|
||||
if term ==# ''
|
||||
let term = matchstr(a:item['text'],
|
||||
\ '\m^\(Definition value for\|undefined definition\) \zs{[^}]\+}\ze')
|
||||
endif
|
||||
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lex_flex_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_limbo_limbo_checker")
|
||||
if exists('g:loaded_syntastic_limbo_limbo_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_limbo_limbo_checker = 1
|
||||
@ -19,7 +19,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_limbo_limbo_GetLocList() dict
|
||||
let include = $INFERNO_HOME != '' ? '-I$INFERNO_HOME ' : ''
|
||||
let include = $INFERNO_HOME !=# '' ? '-I$INFERNO_HOME ' : ''
|
||||
" don't generate .dis in current dir while checking syntax,
|
||||
" .dis should be generated by `mk`
|
||||
let output = filereadable('mkfile') ? (' ' . syntastic#c#NullOutput()) : ''
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_lisp_clisp_checker")
|
||||
if exists('g:loaded_syntastic_lisp_clisp_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lisp_clisp_checker = 1
|
||||
@ -20,7 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_lisp_clisp_GetLocList() dict
|
||||
let tmpdir = syntastic#util#tmpdir()
|
||||
let out = tmpdir != '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : ''
|
||||
let out = tmpdir !=# '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : ''
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-q',
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_llvm_llvm_checker")
|
||||
if exists('g:loaded_syntastic_llvm_llvm_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_llvm_llvm_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_lua_luac_checker")
|
||||
if exists('g:loaded_syntastic_lua_luac_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lua_luac_checker = 1
|
||||
@ -21,7 +21,7 @@ set cpo&vim
|
||||
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
||||
let result = ''
|
||||
let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''')
|
||||
if near != ''
|
||||
if near !=# ''
|
||||
if near ==# '<eof>'
|
||||
let p = getpos('$')
|
||||
let a:pos['lnum'] = p[1]
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_lua_luacheck_checker")
|
||||
if exists('g:loaded_syntastic_lua_luacheck_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lua_luacheck_checker = 1
|
||||
@ -19,27 +19,27 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_lua_luacheck_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m''\zs\S\+\ze''')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V\<' . escape(term, '\') . '\>'
|
||||
endif
|
||||
|
||||
let term = matchstr(a:item['text'], '\m\(accessing undefined\|setting non-standard global\|' .
|
||||
\ 'setting non-module global\|unused global\) variable \zs\S\+')
|
||||
if term == ''
|
||||
if term ==# ''
|
||||
let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze was previously defined')
|
||||
endif
|
||||
if term == ''
|
||||
if term ==# ''
|
||||
let term = matchstr(a:item['text'], '\munused \(variable\|argument\|loop variable\) \zs\S\+')
|
||||
endif
|
||||
if term == ''
|
||||
if term ==# ''
|
||||
let term = matchstr(a:item['text'], '\m\(value assigned to variable\|value of argument\|' .
|
||||
\ 'value of loop variable\) \zs\S\+')
|
||||
endif
|
||||
if term == ''
|
||||
if term ==# ''
|
||||
let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze is never set')
|
||||
endif
|
||||
|
||||
return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lua_luacheck_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_markdown_mdl_checker")
|
||||
if exists('g:loaded_syntastic_markdown_mdl_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_markdown_mdl_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_matlab_mlint_checker")
|
||||
if exists('g:loaded_syntastic_matlab_mlint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_matlab_mlint_checker = 1
|
||||
@ -28,7 +28,7 @@ function! SyntaxCheckers_matlab_mlint_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
49
sources_non_forked/syntastic/syntax_checkers/mercury/mmc.vim
Normal file
49
sources_non_forked/syntastic/syntax_checkers/mercury/mmc.vim
Normal file
@ -0,0 +1,49 @@
|
||||
"============================================================================
|
||||
"File: mercury.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Joshua Rahm (joshuarahm@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_mercury_mmc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_mercury_mmc_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_mercury_mmc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '-e' })
|
||||
|
||||
let errorformat =
|
||||
\ '%C%f:%l: %m,' .
|
||||
\ '%E%f:%l: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
for e in loclist
|
||||
if stridx(e['text'], ' warning:') >= 0
|
||||
let e['type'] = 'W'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'mercury',
|
||||
\ 'name': 'mmc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_nasm_nasm_checker")
|
||||
if exists('g:loaded_syntastic_nasm_nasm_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nasm_nasm_checker = 1
|
||||
|
44
sources_non_forked/syntastic/syntax_checkers/nix/nix.vim
Normal file
44
sources_non_forked/syntastic/syntax_checkers/nix/nix.vim
Normal file
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: nix.vim
|
||||
"Description: Check nix syntax using 'nix-instantiate --eval-only'
|
||||
"Maintainer: Tim Cuthbertson <tim@gfxmonk.net>
|
||||
"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_nix_nix_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nix_nix_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_nix_nix_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '--parse-only' })
|
||||
|
||||
let errorformat =
|
||||
\ '%m\, at %f:%l:%c,' .
|
||||
\ '%m at %f\, line %l:,' .
|
||||
\ 'error: %m\, in %f'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'nix',
|
||||
\ 'name': 'nix',
|
||||
\ 'exec': 'nix-instantiate' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_nroff_mandoc_checker")
|
||||
if exists('g:loaded_syntastic_nroff_mandoc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nroff_mandoc_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_objc_oclint_checker")
|
||||
if exists('g:loaded_syntastic_objc_oclint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objc_oclint_checker = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_objcpp_oclint_checker")
|
||||
if exists('g:loaded_syntastic_objcpp_oclint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objcpp_oclint_checker = 1
|
||||
|
@ -10,15 +10,15 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_ocaml_camlp4o_checker")
|
||||
if exists('g:loaded_syntastic_ocaml_camlp4o_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ocaml_camlp4o_checker = 1
|
||||
|
||||
if exists('g:syntastic_ocaml_camlp4r') && g:syntastic_ocaml_camlp4r != 0
|
||||
let s:ocamlpp="camlp4r"
|
||||
let s:ocamlpp='camlp4r'
|
||||
else
|
||||
let s:ocamlpp="camlp4o"
|
||||
let s:ocamlpp='camlp4o'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@ -34,7 +34,7 @@ if !exists('g:syntastic_ocaml_use_janestreet_core')
|
||||
let g:syntastic_ocaml_use_janestreet_core = 0
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")
|
||||
if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable('ocamlbuild')
|
||||
let g:syntastic_ocaml_use_ocamlbuild = 0
|
||||
endif
|
||||
|
||||
@ -46,7 +46,7 @@ endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
|
||||
let makeprg = s:GetMakeprg()
|
||||
if makeprg == ''
|
||||
if makeprg ==# ''
|
||||
return []
|
||||
endif
|
||||
|
||||
@ -66,7 +66,7 @@ function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
@ -94,18 +94,18 @@ endfunction " }}}2
|
||||
|
||||
function! s:GetOcamlcMakeprg() " {{{2
|
||||
if g:syntastic_ocaml_use_janestreet_core
|
||||
let build_cmd = "ocamlc -I "
|
||||
let build_cmd = 'ocamlc -I '
|
||||
let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir, 1)
|
||||
let build_cmd .= " -c " . syntastic#util#shexpand('%')
|
||||
let build_cmd .= ' -c ' . syntastic#util#shexpand('%')
|
||||
return build_cmd
|
||||
else
|
||||
return "ocamlc -c " . syntastic#util#shexpand('%')
|
||||
return 'ocamlc -c ' . syntastic#util#shexpand('%')
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetOcamlBuildMakeprg() " {{{2
|
||||
return "ocamlbuild -quiet -no-log -tag annot," . s:ocamlpp . " -no-links -no-hygiene -no-sanitize " .
|
||||
\ syntastic#util#shexpand('%:r') . ".cmi"
|
||||
return 'ocamlbuild -quiet -no-log -tag annot,' . s:ocamlpp . ' -no-links -no-hygiene -no-sanitize ' .
|
||||
\ syntastic#util#shexpand('%:r') . '.cmi'
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetOtherMakeprg() " {{{2
|
||||
@ -114,15 +114,15 @@ function! s:GetOtherMakeprg() " {{{2
|
||||
"TODO: should use throw/catch instead of returning an empty makeprg
|
||||
|
||||
let extension = expand('%:e', 1)
|
||||
let makeprg = ""
|
||||
let makeprg = ''
|
||||
|
||||
if stridx(extension, 'mly') >= 0 && executable("menhir")
|
||||
if stridx(extension, 'mly') >= 0 && executable('menhir')
|
||||
" ocamlyacc output can't be redirected, so use menhir
|
||||
let makeprg = "menhir --only-preprocess " . syntastic#util#shexpand('%') . " >" . syntastic#util#DevNull()
|
||||
elseif stridx(extension,'mll') >= 0 && executable("ocamllex")
|
||||
let makeprg = "ocamllex -q " . syntastic#c#NullOutput() . " " . syntastic#util#shexpand('%')
|
||||
let makeprg = 'menhir --only-preprocess ' . syntastic#util#shexpand('%') . ' >' . syntastic#util#DevNull()
|
||||
elseif stridx(extension,'mll') >= 0 && executable('ocamllex')
|
||||
let makeprg = 'ocamllex -q ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
|
||||
else
|
||||
let makeprg = "camlp4o " . syntastic#c#NullOutput() . " " . syntastic#util#shexpand('%')
|
||||
let makeprg = 'camlp4o ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
|
||||
endif
|
||||
|
||||
return makeprg
|
||||
|
@ -51,12 +51,6 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_perl_GetLocList() dict
|
||||
if !exists('g:syntastic_enable_perl_checker') || !g:syntastic_enable_perl_checker
|
||||
call syntastic#log#error('checker perl/perl: checks disabled for security reasons; ' .
|
||||
\ 'set g:syntastic_enable_perl_checker to 1 to override')
|
||||
return []
|
||||
endif
|
||||
|
||||
if type(g:syntastic_perl_lib_path) == type('')
|
||||
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
@ -91,7 +85,8 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'perl',
|
||||
\ 'name': 'perl'})
|
||||
\ 'name': 'perl',
|
||||
\ 'enable': 'enable_perl_checker'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_perl_perlcritic_checker")
|
||||
if exists('g:loaded_syntastic_perl_perlcritic_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_perl_perlcritic_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_perl_podchecker_checker")
|
||||
if exists('g:loaded_syntastic_perl_podchecker_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_perl_podchecker_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_php_checker")
|
||||
if exists('g:loaded_syntastic_php_php_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_php_checker = 1
|
||||
@ -20,7 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_php_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phpcs_checker")
|
||||
if exists('g:loaded_syntastic_php_phpcs_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpcs_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phplint_checker")
|
||||
if exists('g:loaded_syntastic_php_phplint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phplint_checker = 1
|
||||
@ -20,31 +20,31 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\(class\|function\|method\) \zs\S\+\ze was declared as')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\maccess forbidden to \(private\|protected\) \(class\|constant\|method\|variable\|\(private\|protected\) property\) \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\musing deprecated \(class\|constant\|method\|property\|variable\) \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_php_phpmd_checker")
|
||||
if exists('g:loaded_syntastic_php_phpmd_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpmd_checker = 1
|
||||
@ -20,35 +20,35 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Avoid using short method names like \S\+::\S\+()\.')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^\S\+ accesses the super-global variable ')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C accesses the super-global variable .*$', '', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C^Constant \S\+ should be defined in uppercase')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C^Constant \(\S\+\) should be defined in uppercase', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\m\\C^The '\\S\\+()' method which returns ")
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, "\\m\\C^The '\\(\\S\\+\\)()' method which returns.*", '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\C variable \S\+ should begin with ')
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, '\m\C.* variable \(\S\+\) should begin with .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'")
|
||||
if term != ''
|
||||
if term !=# ''
|
||||
return '\V'.substitute(term, "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '')
|
||||
endif
|
||||
return ''
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_po_msgfmt_checker")
|
||||
if exists('g:loaded_syntastic_po_msgfmt_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_po_msgfmt_checker = 1
|
||||
@ -20,7 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown')
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
return term !=# '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_po_msgfmt_GetLocList() dict
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_pod_podchecker_checker")
|
||||
if exists('g:loaded_syntastic_pod_podchecker_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_pod_podchecker_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_puppet_puppet_checker")
|
||||
if exists('g:loaded_syntastic_puppet_puppet_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_puppet_puppet_checker = 1
|
||||
|
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_puppet_puppetlint_checker")
|
||||
if exists('g:loaded_syntastic_puppet_puppetlint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_puppet_puppetlint_checker = 1
|
||||
@ -19,20 +19,20 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
|
||||
call self.log("executable('puppet') = " . executable('puppet') . ', ' .
|
||||
\ "executable(" . string(self.getExec()) . ") = " . executable(self.getExec()))
|
||||
if !executable('puppet') || !executable(self.getExec())
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
let ver = self.getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 1, 10])
|
||||
let s:puppetlint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 2])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict
|
||||
call syntastic#log#deprecationWarn('puppet_lint_arguments', 'puppet_puppetlint_args')
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:%{linenumber}"' })
|
||||
\ 'args_after':
|
||||
\ '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:' .
|
||||
\ (s:puppetlint_new ? '%{line}' : '%{linenumber}') . '"' })
|
||||
|
||||
let errorformat = '%t%*[a-zA-Z] %m at %f:%l'
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_flake8_checker")
|
||||
if exists('g:loaded_syntastic_python_flake8_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_flake8_checker = 1
|
||||
|
@ -36,17 +36,17 @@ function! SyntaxCheckers_python_frosted_GetLocList() dict
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
for e in loclist
|
||||
let e["col"] += 1
|
||||
let e['col'] += 1
|
||||
|
||||
let parts = matchlist(e.text, '\v^([EW]\d+):([^:]*):(.+)')
|
||||
if len(parts) >= 4
|
||||
let e["type"] = parts[1][0]
|
||||
let e["text"] = parts[3] . ' [' . parts[1] . ']'
|
||||
let e["hl"] = '\V\<' . escape(parts[2], '\') . '\>'
|
||||
elseif e["text"] =~? '\v^I\d+:'
|
||||
let e["valid"] = 0
|
||||
let e['type'] = parts[1][0]
|
||||
let e['text'] = parts[3] . ' [' . parts[1] . ']'
|
||||
let e['hl'] = '\V\<' . escape(parts[2], '\') . '\>'
|
||||
elseif e['text'] =~? '\v^I\d+:'
|
||||
let e['valid'] = 0
|
||||
else
|
||||
let e["vcol"] = 0
|
||||
let e['vcol'] = 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_python_mypy_checker")
|
||||
if exists('g:loaded_syntastic_python_mypy_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_mypy_checker = 1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user