1515 pass
1616
1717
18- def code_check ():
18+ def code_check (): # noqa
1919 """Run pylama and check current file.
2020
2121 :return bool:
@@ -25,26 +25,29 @@ def code_check():
2525
2626 from pylama .core import run
2727 from pylama .main import parse_options
28+ from pylama .config import _override_options
2829
2930 if not env .curbuf .name :
3031 return env .stop ()
3132
32- linters = env .var ('g:pymode_lint_checkers' )
33- env .debug (linters )
34-
3533 options = parse_options (
36- linters = linters , force = 1 ,
34+ force = 1 ,
3735 ignore = env .var ('g:pymode_lint_ignore' ),
3836 select = env .var ('g:pymode_lint_select' ),
3937 )
4038
41- for linter in linters :
42- opts = env .var ('g:pymode_lint_options_%s' % linter , silence = True )
43- if opts :
44- options .linters_params [linter ] = options .linters_params .get (linter , {})
45- options .linters_params [linter ].update (opts )
46- options .linters_params ['pylint' ]['clear_cache' ] = True
39+ linters = env .var ('g:pymode_lint_checkers' , default = [])
40+ if linters :
41+ _override_options (options , linters = "," .join (linters ))
42+
43+ for linter in dict (options .linters ):
44+ opts = env .var ('g:pymode_lint_options_%s' % linter , silence = True )
45+ if opts :
46+ options .linters_params [linter ] = options .linters_params .get (linter , {})
47+ options .linters_params [linter ].update (opts )
4748
49+ if 'pylint' in options .linters_params :
50+ options .linters_params ['pylint' ]['clear_cache' ] = True
4851 env .debug (options )
4952
5053 path = os .path .relpath (env .curbuf .name , env .curdir )
0 commit comments