1
0
mirror of https://github.com/gryf/pylint-vim.git synced 2026-04-25 15:21:25 +02:00

4 Commits

2 changed files with 10 additions and 5 deletions
+8 -1
View File
@@ -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([])')
+1 -3
View File
@@ -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)