Skip to content

Instantly share code, notes, and snippets.

@james-d-mitchell
Last active April 19, 2018 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james-d-mitchell/7eccd42562abf3401b192cf2626725a0 to your computer and use it in GitHub Desktop.
Save james-d-mitchell/7eccd42562abf3401b192cf2626725a0 to your computer and use it in GitHub Desktop.
"============================================================================
"File: gaplint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: jdm3@st-andrews.ac.uk
"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_gap_gaplint_checker')
finish
endif
let g:loaded_syntastic_gap_gaplint_checker = 1
if !exists('g:syntastic_gap_gaplint_thres')
let g:syntastic_gap_gaplint_thres = 1
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_gap_gaplint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '' })
let errorformat = '%A%f:%l: %m [%t]'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'returns': [0, 1] })
" change error types according to the prescribed threshold
for e in loclist
let e['type'] = e['type'] < g:syntastic_gap_gaplint_thres ? 'W' : 'E'
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'gap',
\ 'name': 'gaplint',
\ 'exec': 'gaplint.py'})
let &cpo = s:save_cpo
unlet s:save_cpo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment