Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb848f62

Browse files
committed
updated pymode/pyfiles files according to2082d0b (various improvements)
1 parentc9f1c3e commitb848f62

File tree

2 files changed

+34
-24
lines changed

2 files changed

+34
-24
lines changed

‎pymode/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Pymode support functions."""
1+
"""Pymode support functions."""
22

33
from __future__importabsolute_import
44

@@ -7,14 +7,18 @@
77

88

99
defauto():
10-
""" Fix PEP8 erorrs in current buffer. """
10+
"""Fix PEP8 erorrs in current buffer.
11+
12+
pymode: uses it in command PymodeLintAuto with pymode#lint#auto()
13+
14+
"""
1115
from .autopep8importfix_file
1216

1317
classOptions(object):
14-
aggressive=2
18+
aggressive=1
1519
diff=False
1620
experimental=True
17-
ignore=vim.eval('g:pymode_lint_ignore')
21+
ignore=vim.eval('g:pymode_lint_ignore').split(',')
1822
in_place=True
1923
indent_size=int(vim.eval('&tabstop'))
2024
line_range=None
@@ -28,7 +32,7 @@ class Options(object):
2832

2933

3034
defget_documentation():
31-
"""Search documentation and append to current buffer."""
35+
"""Search documentation and append to current buffer."""
3236
from ._compatimportStringIO
3337

3438
sys.stdout,_=StringIO(),sys.stdout

‎pymode/lint.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
pass
1616

1717

18-
defcode_check():# noqa
18+
defcode_check():
1919
"""Run pylama and check current file.
2020
2121
:return bool:
@@ -24,32 +24,38 @@ def code_check(): # noqa
2424
withsilence_stderr():
2525

2626
frompylama.coreimportrun
27-
frompylama.mainimportparse_options
28-
frompylama.configimport_override_options
27+
frompylama.configimportparse_options
2928

3029
ifnotenv.curbuf.name:
3130
returnenv.stop()
3231

32+
linters=env.var('g:pymode_lint_checkers')
33+
env.debug(linters)
34+
35+
# Fixed in v0.9.3: these two parameters may be passed as strings.
36+
# DEPRECATE: v:0.10.0: need to be set as lists.
37+
ifisinstance(env.var('g:pymode_lint_ignore'),str):
38+
ignore=env.var('g:pymode_lint_ignore').split(',')
39+
else:
40+
ignore=env.var('g:pymode_lint_ignore')
41+
ifisinstance(env.var('g:pymode_lint_select'),str):
42+
select=env.var('g:pymode_lint_select').split(',')
43+
else:
44+
select=env.var('g:pymode_lint_select')
3345
options=parse_options(
34-
force=1,
35-
ignore=env.var('g:pymode_lint_ignore'),
36-
select=env.var('g:pymode_lint_select'),
46+
linters=linters,force=1,
47+
ignore=ignore,
48+
select=select,
3749
)
38-
39-
linters=env.var('g:pymode_lint_checkers',default=[])
40-
iflinters:
41-
_override_options(options,linters=",".join(linters))
42-
43-
forlinterindict(options.linters):
44-
opts=env.var('g:pymode_lint_options_%s'%linter,silence=True)
45-
ifopts:
46-
options.linters_params[linter]=options.linters_params.get(linter, {})
47-
options.linters_params[linter].update(opts)
48-
49-
if'pylint'inoptions.linters_params:
50-
options.linters_params['pylint']['clear_cache']=True
5150
env.debug(options)
5251

52+
forlinterinlinters:
53+
opts=env.var('g:pymode_lint_options_%s'%linter,silence=True)
54+
ifopts:
55+
options.linters_params[linter]=options.linters_params.get(
56+
linter, {})
57+
options.linters_params[linter].update(opts)
58+
5359
path=os.path.relpath(env.curbuf.name,env.curdir)
5460
env.debug("Start code check: ",path)
5561

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp