mirror of
https://github.com/gryf/pylint-vim.git
synced 2026-04-25 15:21:25 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c4d9d30f6 | |||
| 0a2c744bd9 | |||
| 2565ed7c96 | |||
| 484e2924e5 |
@@ -3,13 +3,16 @@ Get pylint oputput on current buffer
|
|||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
try:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
|
except ImportError:
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pylint import lint
|
from pylint import lint
|
||||||
from pylint.reporters.text import TextReporter
|
from pylint.reporters.text import TextReporter
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise AssertionError('Error: pylint_fm.vim requires module pylint')
|
lint = None
|
||||||
|
|
||||||
import vim
|
import vim
|
||||||
|
|
||||||
@@ -25,6 +28,10 @@ class VImPylint(object):
|
|||||||
def run(self):
|
def run(self):
|
||||||
"""execute pylint and fill the quickfix"""
|
"""execute pylint and fill the quickfix"""
|
||||||
|
|
||||||
|
if not lint:
|
||||||
|
vim.command("echo 'Error: pylint_fm.vim requires module pylint'")
|
||||||
|
return
|
||||||
|
|
||||||
# clear QF window
|
# clear QF window
|
||||||
vim.command('call setqflist([])')
|
vim.command('call setqflist([])')
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,8 @@
|
|||||||
|
|
||||||
let s:plugin_path = expand('<sfile>:p:h', 1)
|
let s:plugin_path = expand('<sfile>:p:h', 1)
|
||||||
|
|
||||||
if exists("b:did_pylint_plugin")
|
if exists(":Pylint")
|
||||||
finish " only load once
|
finish " only load once
|
||||||
else
|
|
||||||
let b:did_pylint_plugin = 1
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:SetPython(msg)
|
function! s:SetPython(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user