Merge branch 'master' into gcc_refactor

This commit is contained in:
LCD 47 2013-05-30 19:29:12 +03:00
commit 4a6ece567a
24 changed files with 309 additions and 79 deletions

View File

@ -25,14 +25,17 @@ demand, or automatically as files are saved. If syntax errors are detected, the
user is notified and is happy because they didn't have to compile their code or user is notified and is happy because they didn't have to compile their code or
execute their script to find them. execute their script to find them.
At the time of this writing, syntax checking plugins exist for ada, applescript, c, co, At the time of this writing, syntax checking plugins exist for Ada,
coffee, coq, cpp, cs, css, cucumber, cuda, d, dart, docbk, elixir, erlang, eruby, fortran, AppleScript, Bourne shell, C, C++, C#, CoffeeScript, Coco, Coq, CSS,
gentoo_metadata, go, haml, haskell, haxe, html, java, javascript, json, less, lisp, lua, matlab, Cucumber, CUDA, D, Dart, DocBook, Elixir, Erlang, eRuby, Fortran, Gentoo
nasm, objc, ocaml, perl, php, puppet, python, rst, ruby, rust, sass/scss, scala, sh, slim, tcl, tex, metadata, Go, Haml, Haskell, Haxe, HTML, Java, JavaScript, JSON, LESS,
twig, typescript, vala, vhdl, xhtml, xml, xslt, yaml, z80, zpt, zsh LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C,
Objective-C++, OCaml, Perl, Perl POD, PHP, Puppet, Python,
reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Twig,
TypeScript, Vala, VHDL, xHtml, XML, XSLT, YAML, z80, Zope page
templates, zsh.
Screenshot ## Screenshot
----------
Below is a screenshot showing the methods that Syntastic uses to display syntax Below is a screenshot showing the methods that Syntastic uses to display syntax
errors. Note that, in practise, you will only have a subset of these methods errors. Note that, in practise, you will only have a subset of these methods
@ -47,14 +50,12 @@ enabled.
5. Hover the mouse over a line containing an error and the error message is displayed as a balloon. 5. Hover the mouse over a line containing an error and the error message is displayed as a balloon.
6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted. 6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted.
Installation ## Installation
------------
Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already
have pathogen working then skip Step 1 and go to Step 2. have pathogen working then skip Step 1 and go to Step 2.
Step 1: Install pathogen.vim ### Step 1: Install pathogen.vim
----------------------------
First I'll show you how to install tpope's [pathogen.vim](https://github.com/tpope/vim-pathogen) so that First I'll show you how to install tpope's [pathogen.vim](https://github.com/tpope/vim-pathogen) so that
it's easy to install syntastic. Do this in your Terminal so that you get the pathogen.vim file it's easy to install syntastic. Do this in your Terminal so that you get the pathogen.vim file
@ -66,10 +67,9 @@ and the directories it needs:
Next you *need to add this* to your ~/.vimrc: Next you *need to add this* to your ~/.vimrc:
call pathogen#infect() execute pathogen#infect()
Step 2: Install syntastic as a pathogen bundle ### Step 2: Install syntastic as a pathogen bundle
----------------------------------------------
You now have pathogen installed and can put syntastic into ~/.vim/bundle like this: You now have pathogen installed and can put syntastic into ~/.vim/bundle like this:
@ -90,16 +90,14 @@ step 1 and make sure you did the following:
4. Have permissions to access all of these directories. 4. Have permissions to access all of these directories.
Google group ## Google group
------------
To get information or make suggestions check out the [google group](https://groups.google.com/group/vim-syntastic). To get information or make suggestions check out the [google group](https://groups.google.com/group/vim-syntastic).
FAQ ## FAQ
---
__Q. I installed syntastic but it isn't reporting any errors ...__ __Q. I installed syntastic but it isn't reporting any errors...__
A. The most likely reason is that the syntax checker that it requires isn't installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executable is required, just look in `syntax_checkers/<filetype>.vim`. Note that aliases do not work; the actual executable must be available in your `$PATH`. Symbolic links are okay. A. The most likely reason is that the syntax checker that it requires isn't installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executable is required, just look in `syntax_checkers/<filetype>.vim`. Note that aliases do not work; the actual executable must be available in your `$PATH`. Symbolic links are okay.
@ -113,35 +111,47 @@ e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use `g:syntasti
See `:help syntastic-checker-options` for more information. See `:help syntastic-checker-options` for more information.
__Q. I run a chacker and the location list is not updated...__
A. By default, the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your vimrc:
```vim
let g:syntastic_always_populate_loc_list=1
```
__Q. How can I pass additional arguments to a checker?__ __Q. How can I pass additional arguments to a checker?__
A. Almost all syntax checkers use the `syntastic#makeprg#build()` function. Those checkers that do can be configured using global variables. The general form of the global args variables are: A. Almost all syntax checkers use the `syntastic#makeprg#build()` function. Those checkers that do can be configured using global variables. The general form of the global args variables are:
```vim
`syntastic_[filetype]_[subchecker]_args` syntastic_[filetype]_[subchecker]_args
```
So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc: So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc:
```vim
`let g:syntastic_ruby_mri_args="--my --args --here"` let g:syntastic_ruby_mri_args="--my --args --here"
```
See `:help syntastic-checker-options` for more information. See `:help syntastic-checker-options` for more information.
__Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ __Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__
A. Stick a line like this in your vimrc: A. Stick a line like this in your vimrc:
```vim
`let g:syntastic_<filetype>_checkers=['<checker-name>']` let g:syntastic_<filetype>_checkers=['<checker-name>']
```
To see the list of checkers for your filetype, look in `syntax_checkers/<filetype>/`. To see the list of checkers for your filetype, look in `syntax_checkers/<filetype>/`.
e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a native `python` checker. e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a native `python` checker.
To tell syntastic to use `pylint`, you would use this setting: To tell syntastic to use `pylint`, you would use this setting:
```vim
`let g:syntastic_python_checkers=['pylint']` let g:syntastic_python_checkers=['pylint']
```
Some filetypes, like PHP, have style checkers as well as syntax checkers. These can be chained together like this: Some filetypes, like PHP, have style checkers as well as syntax checkers. These can be chained together like this:
```vim
`let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']` let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']
```
This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`. This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`.
@ -149,11 +159,11 @@ __Q. How can I jump between the different errors without using the location list
A. Vim provides several built in commands for this. See `:help :lnext` and `:help :lprev`. A. Vim provides several built in commands for this. See `:help :lnext` and `:help :lprev`.
If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired](https://github.com/tpope/vim-unimpaired) - which provides such mappings (among other things). If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired](https://github.com/tpope/vim-unimpaired), which provides such mappings (among other things).
__Q. A syntax checker is giving me unwanted/strange style tips?__ __Q. A syntax checker is giving me unwanted/strange style tips?__
A. Some filetypes (e.g. php) have style checkers as well as syntax checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the syntax checker integration file (e.g. `syntax_checkers/php.vim`) to see what options are available. A. Some filetypes (e.g. php) have style checkers as well as syntax checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the [wiki](https://github.com/scrooloose/syntastic/wiki/Syntaxcheckers) to see what options are available.
__Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ __Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__

View File

@ -43,18 +43,20 @@ function! syntastic#util#parseShebang()
return {'exe': '', 'args': []} return {'exe': '', 'args': []}
endfunction endfunction
" Verify that the 'installed' version is at the 'required' version, if not " Run 'command' in a shell and parse output as a version string.
" better. " Returns an array of version components.
function! syntastic#util#parseVersion(command)
return split(matchstr( system(a:command), '\v^\D*\zs\d+(\.\d+)+\ze' ), '\.')
endfunction
" Verify that the 'installed' version is at least the 'required' version.
" "
" 'installed' and 'required' must be arrays. Only the " 'installed' and 'required' must be arrays. If they have different lengths,
" first three elements (major, minor, patch) are looked at. " the "missing" elements will be assumed to be 0 for the purposes of checking.
"
" Either array may be less than three elements. The "missing" elements
" will be assumed to be '0' for the purposes of checking.
" "
" See http://semver.org for info about version numbers. " See http://semver.org for info about version numbers.
function! syntastic#util#versionIsAtLeast(installed, required) function! syntastic#util#versionIsAtLeast(installed, required)
for index in [0,1,2] for index in range(max([len(a:installed), len(a:required)]))
if len(a:installed) <= index if len(a:installed) <= index
let installed_element = 0 let installed_element = 0
else else

View File

@ -133,9 +133,9 @@ function! s:UpdateErrors(auto_invoked, ...)
let loclist = g:SyntasticLoclist.current() let loclist = g:SyntasticLoclist.current()
call s:notifiers.refresh(loclist) call s:notifiers.refresh(loclist)
if (g:syntastic_always_populate_loc_list || g:syntastic_auto_jump) && loclist.hasErrorsOrWarningsToDisplay() if g:syntastic_always_populate_loc_list || g:syntastic_auto_jump
call setloclist(0, loclist.filteredRaw()) call setloclist(0, loclist.filteredRaw())
if g:syntastic_auto_jump if g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay()
silent! lrewind silent! lrewind
endif endif
endif endif
@ -354,7 +354,11 @@ function! SyntasticMake(options)
endif endif
" Apply ignore patterns " Apply ignore patterns
call filter(errors, '!s:IgnoreFile(bufname(str2nr(v:val["bufnr"])))') let ignore = {}
for buf in syntastic#util#unique(map(copy(errors), 'v:val["bufnr"]'))
let ignore[buf] = s:IgnoreFile(bufname(str2nr(buf)))
endfor
call filter(errors, '!ignore[v:val["bufnr"]]')
" Add subtype info if present. " Add subtype info if present.
if has_key(a:options, 'subtype') if has_key(a:options, 'subtype')

View File

@ -133,8 +133,8 @@ endfunction
"display the cached errors for this buf in the location list "display the cached errors for this buf in the location list
function! g:SyntasticLoclist.show() function! g:SyntasticLoclist.show()
if self.hasErrorsOrWarningsToDisplay()
call setloclist(0, self.filteredRaw()) call setloclist(0, self.filteredRaw())
if self.hasErrorsOrWarningsToDisplay()
let num = winnr() let num = winnr()
exec "lopen " . g:syntastic_loc_list_height exec "lopen " . g:syntastic_loc_list_height
if num != winnr() if num != winnr()

View File

@ -9,7 +9,11 @@ let s:defaultCheckers = {
\ 'cpp': ['gcc'], \ 'cpp': ['gcc'],
\ 'html': ['tidy'], \ 'html': ['tidy'],
\ 'java': ['javac'], \ 'java': ['javac'],
\ 'javascript': ['jshint', 'jslint'],
\ 'objc': ['gcc'], \ 'objc': ['gcc'],
\ 'objcpp': ['gcc'],
\ 'perl': ['perl'],
\ 'python': ['python', 'flake8', 'pylint'],
\ 'php': ['php', 'phpcs', 'phpmd'], \ 'php': ['php', 'phpcs', 'phpmd'],
\ 'ruby': ['mri'] \ 'ruby': ['mri']
\ } \ }

View File

@ -8,10 +8,10 @@
" Want To Public License, Version 2, as published by Sam Hocevar. " Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================ "============================================================================
if exists("loaded_checkpatch_syntax_checker") if exists("g:loaded_syntastic_c_checkpatch_checker")
finish finish
endif endif
let loaded_checkpatch_syntax_checker = 1 let g:loaded_syntastic_c_checkpatch_checker = 1
" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed. " Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed.
if executable("checkpatch.pl") if executable("checkpatch.pl")

View File

@ -10,10 +10,10 @@
" "
"============================================================================ "============================================================================
if exists('loaded_make_syntax_checker') if exists('g:loaded_syntastic_c_make_checker')
finish finish
endif endif
let loaded_make_syntax_checker = 1 let g:loaded_syntastic_c_make_checker = 1
function SyntaxCheckers_c_make_IsAvailable() function SyntaxCheckers_c_make_IsAvailable()
return executable('make') return executable('make')

View File

@ -0,0 +1,57 @@
"============================================================================
"File: oclint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
"============================================================================
"
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
" that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_oclint_config':
"
" let g:syntastic_oclint_config_file = '.config'
if exists("g:loaded_syntastic_c_oclint_checker")
finish
endif
let g:loaded_syntastic_c_oclint_checker = 1
function! SyntaxCheckers_c_oclint_IsAvailable()
return executable("oclint")
endfunction
if !exists('g:syntastic_oclint_config_file')
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
endif
function! SyntaxCheckers_c_oclint_GetLocList()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'oclint',
\ 'args': '-text',
\ 'post_args': '-- -c' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file),
\ 'subchecker': 'oclint' })
let errorformat =
\ '%E%f:%l:%c: %m P1 ,' .
\ '%E%f:%l:%c: %m P2 ,' .
\ '%W%f:%l:%c: %m P3 ,' .
\ '%E%f:%l:%c: fatal error: %m,' .
\ '%E%f:%l:%c: error: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'postprocess': ['compressWhitespace', 'sort'] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'oclint'})

View File

@ -16,10 +16,10 @@
" "
" let g:syntastic_sparse_config_file = '.config' " let g:syntastic_sparse_config_file = '.config'
if exists("loaded_sparse_syntax_checker") if exists("g:loaded_syntastic_c_sparse_checker")
finish finish
endif endif
let loaded_sparse_syntax_checker = 1 let g:loaded_syntastic_c_sparse_checker = 1
function! SyntaxCheckers_c_sparse_IsAvailable() function! SyntaxCheckers_c_sparse_IsAvailable()
return executable("sparse") return executable("sparse")

View File

@ -16,10 +16,10 @@
" "
" let g:syntastic_splint_config_file = '.config' " let g:syntastic_splint_config_file = '.config'
if exists("loaded_splint_syntax_checker") if exists("g:loaded_syntastic_c_splint_checker")
finish finish
endif endif
let loaded_splint_syntax_checker = 1 let g:loaded_syntastic_c_splint_checker = 1
function! SyntaxCheckers_c_splint_IsAvailable() function! SyntaxCheckers_c_splint_IsAvailable()
return executable("splint") return executable("splint")

View File

@ -10,10 +10,10 @@
" "
"============================================================================ "============================================================================
if exists("loaded_ycm_c_syntax_checker") if exists("g:loaded_syntastic_c_ycm_checker")
finish finish
endif endif
let loaded_ycm_c_syntax_checker = 1 let g:loaded_syntastic_c_ycm_checker = 1
function! SyntaxCheckers_c_ycm_IsAvailable() function! SyntaxCheckers_c_ycm_IsAvailable()
return exists('g:loaded_youcompleteme') return exists('g:loaded_youcompleteme')

View File

@ -21,7 +21,6 @@ endfunction
function! SyntaxCheckers_coffee_coffee_GetLocList() function! SyntaxCheckers_coffee_coffee_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coffee', \ 'exe': 'coffee',
\ 'args': '--lint',
\ 'subchecker': 'coffee' }) \ 'subchecker': 'coffee' })
let errorformat = let errorformat =
\ '%E%f:%l:%c: %trror: %m,' . \ '%E%f:%l:%c: %trror: %m,' .

View File

@ -0,0 +1,36 @@
"============================================================================
"File: oclint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
"============================================================================
"
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
" that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_oclint_config':
"
" let g:syntastic_oclint_config_file = '.config'
if exists("g:loaded_syntastic_cpp_oclint_checker")
finish
endif
let g:loaded_syntastic_cpp_oclint_checker = 1
runtime syntax_checkers/c/oclint.vim
function! SyntaxCheckers_cpp_oclint_IsAvailable()
return SyntaxCheckers_c_oclint_IsAvailable()
endfunction
function! SyntaxCheckers_cpp_oclint_GetLocList()
return SyntaxCheckers_c_oclint_GetLocList()
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp',
\ 'name': 'oclint'})

View File

@ -10,10 +10,10 @@
" "
"============================================================================ "============================================================================
if exists("loaded_ycm_cpp_syntax_checker") if exists("g:loaded_syntastic_cpp_ycm_checker")
finish finish
endif endif
let loaded_ycm_cpp_syntax_checker = 1 let g:loaded_syntastic_cpp_ycm_checker = 1
runtime syntax_checkers/c/ycm.vim runtime syntax_checkers/c/ycm.vim

View File

@ -36,8 +36,7 @@ function! SyntaxCheckers_javascript_jshint_GetLocList()
endfunction endfunction
function s:JshintNew() function s:JshintNew()
let ver = matchlist(system('jshint --version'), '^\D*\(\d\+\)\.\(\d\+\)') return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1])
return (ver[1] > 1 || (ver[1] == 1 && ver[2] >= 1))
endfunction endfunction
function s:Args() function s:Args()

View File

@ -0,0 +1,36 @@
"============================================================================
"File: oclint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
"============================================================================
"
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
" that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_oclint_config':
"
" let g:syntastic_oclint_config_file = '.config'
if exists("g:loaded_syntastic_objc_oclint_checker")
finish
endif
let g:loaded_syntastic_objc_oclint_checker = 1
runtime syntax_checkers/c/oclint.vim
function! SyntaxCheckers_objc_oclint_IsAvailable()
return SyntaxCheckers_c_oclint_IsAvailable()
endfunction
function! SyntaxCheckers_objc_oclint_GetLocList()
return SyntaxCheckers_c_oclint_GetLocList()
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'objc',
\ 'name': 'oclint'})

View File

@ -10,10 +10,10 @@
" "
"============================================================================ "============================================================================
if exists("loaded_ycm_objc_syntax_checker") if exists("g:loaded_syntastic_objc_ycm_checker")
finish finish
endif endif
let loaded_ycm_objc_syntax_checker = 1 let g:loaded_syntastic_objc_ycm_checker = 1
runtime syntax_checkers/c/ycm.vim runtime syntax_checkers/c/ycm.vim

View File

@ -0,0 +1,36 @@
"============================================================================
"File: oclint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
"============================================================================
"
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
" that contains additional compiler arguments like include directories or
" CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_oclint_config':
"
" let g:syntastic_oclint_config_file = '.config'
if exists("g:loaded_syntastic_objcpp_oclint_checker")
finish
endif
let g:loaded_syntastic_objcpp_oclint_checker = 1
runtime syntax_checkers/c/oclint.vim
function! SyntaxCheckers_objcpp_oclint_IsAvailable()
return SyntaxCheckers_c_oclint_IsAvailable()
endfunction
function! SyntaxCheckers_objcpp_oclint_GetLocList()
return SyntaxCheckers_c_oclint_GetLocList()
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'objcpp',
\ 'name': 'oclint'})

View File

@ -10,10 +10,10 @@
" "
"============================================================================ "============================================================================
if exists("loaded_ycm_objcpp_syntax_checker") if exists("g:loaded_syntastic_objcpp_ycm_checker")
finish finish
endif endif
let loaded_ycm_objcpp_syntax_checker = 1 let g:loaded_syntastic_objcpp_ycm_checker = 1
runtime syntax_checkers/c/ycm.vim runtime syntax_checkers/c/ycm.vim

View File

@ -33,19 +33,14 @@ endif
function! s:PuppetVersion() function! s:PuppetVersion()
if !exists("s:puppet_version") if !exists("s:puppet_version")
let output = system("puppet --version 2>/dev/null") let s:puppet_version = syntastic#util#parseVersion("puppet --version 2>/dev/null")
let output = substitute(output, '\n$', '', '')
let s:puppet_version = split(output, '\.')
endif endif
return s:puppet_version return s:puppet_version
endfunction endfunction
function! s:PuppetLintVersion() function! s:PuppetLintVersion()
if !exists("s:puppet_lint_version") if !exists("s:puppet_lint_version")
let output = system("puppet-lint --version 2>/dev/null") let s:puppet_lint_version = syntastic#util#parseVersion("puppet-lint --version 2>/dev/null")
let output = substitute(output, '\n$', '', '')
let output = substitute(output, '^puppet-lint ', '', 'i')
let s:puppet_lint_version = split(output, '\.')
endif endif
return s:puppet_lint_version return s:puppet_lint_version
endfunction endfunction

View File

@ -21,10 +21,7 @@ endfunction
function! s:SlimrbVersion() function! s:SlimrbVersion()
if !exists('s:slimrb_version') if !exists('s:slimrb_version')
let output = system("slimrb --version 2>/dev/null") let s:slimrb_version = syntastic#util#parseVersion('slimrb --version 2>/dev/null')
let output = substitute(output, '\n$', '', '')
let output = substitute(output, '^slim ', '', 'i')
let s:slimrb_version = split(output, '\.')
end end
return s:slimrb_version return s:slimrb_version
endfunction endfunction

View File

@ -0,0 +1,50 @@
"============================================================================
"File: atdtool.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists("g:loaded_syntastic_text_atdtool_checker")
finish
endif
let g:loaded_syntastic_text_atdtool_checker = 1
function! SyntaxCheckers_text_atdtool_IsAvailable()
return executable('atdtool')
endfunction
function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item)
return matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)')
endfunction
function! SyntaxCheckers_text_atdtool_GetLocList()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'atdtool',
\ 'tail': '2>/dev/null',
\ 'subchecker': 'atdtool' })
let errorformat =
\ '%W%f:%l:%c: %m,'.
\ '%+C suggestions:%.%#'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
for n in range(len(loclist))
let loclist[n]['text'] = substitute(loclist[n]['text'], '\n\s\+', ' | ', 'g')
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'text',
\ 'name': 'atdtool'})

View File

@ -22,6 +22,11 @@
" "
"============================================================================ "============================================================================
if exists("g:loaded_syntastic_vala_valac_checker")
finish
endif
let g:loaded_syntastic_vala_valac_checker = 1
function! SyntaxCheckers_vala_valac_IsAvailable() function! SyntaxCheckers_vala_valac_IsAvailable()
return executable('valac') return executable('valac')
endfunction endfunction

View File

@ -9,10 +9,10 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
if exists("loaded_vhdl_ghdl_syntax_checker") if exists("g:loaded_syntastic_vhdl_ghdl_checker")
finish finish
endif endif
let loaded_vhdl_ghdl_syntax_checker = 1 let g:loaded_syntastic_vhdl_ghdl_checker = 1
function! SyntaxCheckers_vhdl_ghdl_IsAvailable() function! SyntaxCheckers_vhdl_ghdl_IsAvailable()
return executable("ghdl") return executable("ghdl")