Skip to content

Commit d2dead6

Browse files
committed
Update pymode.
1 parent 70d6bf5 commit d2dead6

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

plugin/pymode.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ call pymode#default("g:pymode_lint_info_symbol", "II")
135135
call pymode#default("g:pymode_lint_pyflakes_symbol", "FF")
136136

137137
" Code checkers options
138-
call pymode#default("g:pymode_lint_options_pep8",
138+
call pymode#default("g:pymode_lint_options_pycodestyle",
139139
\ {'max_line_length': g:pymode_options_max_line_length})
140140

141141
call pymode#default("g:pymode_lint_options_pylint",

pymode/environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def lines(self):
5959
return [l.decode(self.options.get('encoding')) for l in self.curbuf]
6060

6161
@staticmethod
62-
def var(name, to_bool=False, silence=False):
62+
def var(name, to_bool=False, silence=False, default=None):
6363
"""Get vim variable.
6464
6565
:return vimobj:
@@ -69,7 +69,7 @@ def var(name, to_bool=False, silence=False):
6969
value = vim.eval(name)
7070
except vim.error:
7171
if silence:
72-
return None
72+
return default
7373
raise
7474

7575
if to_bool:

pymode/lint.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
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

Comments
 (0)