Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b31972

Browse files
committed
Merge branch 'release/0.7.7b'
2 parents 41999ff + c6aef54 commit 9b31972

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

Changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
## 2013-12-04 0.7.6b
4+
## 2013-12-04 0.7.7b
55
--------------------
66
* Update indentation support;
77
* Python3 support;

doc/pymode.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~
77

88

9-
Version: 0.7.6b
9+
Version: 0.7.7b
1010

1111
==============================================================================
1212
CONTENTS *pymode-contents*

plugin/pymode.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" vi: fdl=1
2-
let g:pymode_version = "0.7.6b"
2+
let g:pymode_version = "0.7.7b"
33

44
com! PymodeVersion echomsg "Current python-mode version: " . g:pymode_version
55
com! PymodeTroubleshooting call pymode#troubleshooting#test()

pymode/lint.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def code_check():
1616
from pylama.main import parse_options
1717
from pylama.tasks import check_path
1818

19+
if not env.curbuf.name:
20+
env.stop()
21+
return False
22+
1923
options = parse_options(
2024
ignore=env.var('g:pymode_lint_ignore'),
2125
select=env.var('g:pymode_lint_select'),
@@ -36,7 +40,7 @@ def code_check():
3640
LOGGER.setLevel(logging.DEBUG)
3741

3842
with silence_stderr():
39-
errors = check_path(path, options=options, code=env.source)
43+
errors = check_path(path, options=options, code='\n'.join(env.curbuf))
4044

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

t/lint.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,17 @@ describe 'pymode check code'
1414
Expect g:pymode_lint == 1
1515
end
1616

17+
it 'lint code'
18+
put =['# coding: utf-8', 'call_unknown_function()']
19+
PymodeLint
20+
Expect getloclist(0) == []
21+
end
22+
23+
it 'lint code'
24+
e t/test.py
25+
PymodeLint
26+
Expect getloclist(0) == [{'lnum': 6, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': 'E', 'pattern': '', 'text': 'W0612 local variable "unused" is assigned to but never used [pyflakes]'}, {'lnum': 8, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': 'E', 'pattern': '', 'text': 'E0602 undefined name "unknown" [pyflakes]'}]
27+
end
28+
1729
end
1830

t/test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
5+
def main():
6+
unused = 1
7+
8+
unknown()

0 commit comments

Comments
 (0)