-
Notifications
You must be signed in to change notification settings - Fork 0
/
teamscale.vim
50 lines (38 loc) · 1.36 KB
/
teamscale.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
" vim compiler file for Teamscale Precommit Analysis
" Compiler: Teamscale Precommit Analysis
" Maintainer: CQSE GmbH
"
" See README.md for installation instructions
if exists("current_compiler")
finish
endif
if !exists("g:teamscale#user")
echoe 'You did not provide a user for Teamscale in g:teamscale#user'
finish
endif
if !exists("g:teamscale#accesskey")
echoe 'You did not provide an access key for Teamscale in g:teamscale#accesskey'
finish
endif
let current_compiler = "teamscale"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
let s:teamscaledev = get(g:, 'teamscale#devpath', 'teamscale-dev')
if !executable(s:teamscaledev)
echoe 'Cannot find teamscale-dev binary. Please set g:teamscale#devpath'
finish
endif
let s:prog = 'NO_COLOR=true ' . shellescape(s:teamscaledev) . ' precommit -u ' . shellescape(g:teamscale#user) . ' -k ' . shellescape(g:teamscale#accesskey)
exe 'CompilerSet makeprg=' . escape(s:prog, '\" ')
CompilerSet errorformat+=%f:%l:%c:\ %trror:\ %m
CompilerSet errorformat+=%f:%l:%c:\ %tarning:\ %m
CompilerSet errorformat+=%f:%l:%c:\ %m
CompilerSet errorformat+=%f:%l:\ %trror:\ %m
CompilerSet errorformat+=%f:%l:\ %tarning:\ %m
CompilerSet errorformat+=%f:%l:\ %m
let b:teamscale = 1
let &cpo = s:cpo_save
unlet s:cpo_save