9
9
" See http://sam.zoy.org/wtfpl/COPYING for more details.
10
10
"
11
11
" ============================================================================
12
- if exists (" g:loaded_syntastic_python_pylama_checker" )
12
+ if exists (' g:loaded_syntastic_python_pylama_checker' )
13
13
finish
14
14
endif
15
- let g: loaded_syntastic_python_pylama_checker= 1
15
+ let g: loaded_syntastic_python_pylama_checker = 1
16
16
17
17
function ! SyntaxCheckers_python_pylama_IsAvailable ()
18
18
return executable (' pylama' )
@@ -25,20 +25,34 @@ endfunction
25
25
function ! SyntaxCheckers_python_pylama_GetLocList ()
26
26
let makeprg = syntastic#makeprg#build ({
27
27
\ ' exe' : ' pylama' ,
28
- \ ' post_args' : ' -f pep8' ,
28
+ \ ' post_args' : ' -f pep8' ,
29
29
\ ' filetype' : ' python' ,
30
30
\ ' subchecker' : ' pylama' })
31
31
32
- let errorformat = ' %A%f:%l:%c: %m'
32
+ " TODO: "WARNING:pylama:..." messages are probably a logging bug
33
+ let errorformat =
34
+ \ ' %-GWARNING:pylama:%.%#,' .
35
+ \ ' %A%f:%l:%c: %m'
33
36
34
- let loclist= SyntasticMake ({
37
+ let loclist = SyntasticMake ({
35
38
\ ' makeprg' : makeprg ,
36
39
\ ' errorformat' : errorformat ,
37
40
\ ' postprocess' : [' sort' ] })
38
41
42
+ " adjust for weirdness in each checker
39
43
for n in range (len (loclist))
40
44
let loclist[n ][' type' ] = match ([' R' , ' C' , ' W' ], loclist[n ][' text' ][0 ]) >= 0 ? ' W' : ' E'
41
- if loclist[n ][' text' ] = ~# ' \v\[%(pep8|pep257|mccabe)\]$'
45
+ if loclist[n ][' text' ] = ~# ' \v\[%(mccabe|pep257|pylint)\]$'
46
+ if has_key (loclist[n ], ' col' )
47
+ let loclist[n ][' col' ] += 1
48
+ endif
49
+ endif
50
+ if loclist[n ][' text' ] = ~# ' \v\[pylint\]$'
51
+ if has_key (loclist[n ], ' vcol' )
52
+ let loclist[n ][' vcol' ] = 0
53
+ endif
54
+ endif
55
+ if loclist[n ][' text' ] = ~# ' \v\[%(mccabe|pep257|pep8)\]$'
42
56
let loclist[n ][' subtype' ] = ' Style'
43
57
endif
44
58
endfor
0 commit comments