Skip to content

Commit 7d368f3

Browse files
committed
Merge branch 'develop' of https://github.com/klen/python-mode into develop
2 parents 6f4bbd4 + 94569bf commit 7d368f3

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

pymode/libs/pylama/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:license: BSD, see LICENSE for more details.
66
"""
77

8-
__version__ = "7.0.4"
8+
__version__ = "7.0.5"
99
__project__ = "pylama"
1010
__author__ = "Kirill Klenov <[email protected]>"
1111
__license__ = "GNU LGPL"

pymode/libs/pylama/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ def run(path='', code=None, rootdir=CURDIR, options=None):
3434
if mask.match(path):
3535
fileconfig.update(options.file_params[mask])
3636

37+
if options.skip and any(p.match(path) for p in options.skip):
38+
LOGGER.info('Skip checking for path: %s', path)
39+
return []
40+
3741
try:
3842
with CodeContext(code, path) as ctx:
3943
code = ctx.code

pymode/libs/pylama/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ def check_path(options, rootdir=None, candidates=None, code=None):
4141
if not op.exists(path):
4242
continue
4343

44-
if options.skip and any(p.match(path) for p in options.skip):
45-
LOGGER.info('Skip path: %s', path)
46-
continue
47-
4844
paths.append(path)
4945

5046
if options.async:

pymode/lint.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def code_check():
2020
"""
2121
with silence_stderr():
2222

23-
from pylama.main import parse_options, check_path
23+
from pylama.core import run
24+
from pylama.main import parse_options
2425

2526
if not env.curbuf.name:
2627
return env.stop()
@@ -54,9 +55,7 @@ def code_check():
5455
from pylama.core import LOGGER, logging
5556
LOGGER.setLevel(logging.DEBUG)
5657

57-
options.paths = [path]
58-
errors = check_path(
59-
options=options, code='\n'.join(env.curbuf) + '\n', rootdir=env.curdir)
58+
errors = run(path, code='\n'.join(env.curbuf) + '\n', options=options)
6059

6160
env.debug("Find errors: ", len(errors))
6261
sort_rules = env.var('g:pymode_lint_sort')

0 commit comments

Comments
 (0)