File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ if exists (' g:loaded_syntastic_swift_swiftlint_checker' )
2
+ finish
3
+ endif
4
+ let g: loaded_syntastic_swift_swiftlint_checker = 1
5
+
6
+ let s: save_cpo = &cpo
7
+ set cpo &vim
8
+
9
+ function ! SyntaxCheckers_swift_swiftlint_GetLocList () dict
10
+ let env_vars = ' SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0=' . syntastic#util#shexpand (' %:p' )
11
+ let makeprg = self .makeprgBuild ({
12
+ \ ' exe_before' : env_vars,
13
+ \ ' fname' : ' ' ,
14
+ \ ' args' : ' lint --use-script-input-files' })
15
+
16
+ let errorformat =
17
+ \ ' %f:%l:%c: %trror: %m,' .
18
+ \ ' %f:%l:%c: %tarning: %m,' .
19
+ \ ' %f:%l: %trror: %m,' .
20
+ \ ' %f:%l: %tarning: %m'
21
+
22
+ let env = {}
23
+ " let env = {
24
+ " \ 'SCRIPT_INPUT_FILE_COUNT': 1,
25
+ " \ 'SCRIPT_INPUT_FILE_0': syntastic#util#shexpand('%:p'),
26
+ " \ }
27
+
28
+ return SyntasticMake ({
29
+ \ ' makeprg' : makeprg ,
30
+ \ ' errorformat' : errorformat ,
31
+ \ ' env' : env })
32
+ endfunction
33
+
34
+ call g: SyntasticRegistry .CreateAndRegisterChecker ({
35
+ \ ' filetype' : ' swift' ,
36
+ \ ' name' : ' swiftlint' })
37
+
38
+ let &cpo = s: save_cpo
39
+ unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments