mirror of
https://github.com/gryf/pylint-vim.git
synced 2025-12-19 12:28:11 +01:00
Be silent in case of lack of pylint
This commit is contained in:
@@ -9,7 +9,7 @@ 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')
|
pylint = None
|
||||||
|
|
||||||
import vim
|
import vim
|
||||||
|
|
||||||
@@ -25,6 +25,10 @@ class VImPylint(object):
|
|||||||
def run(self):
|
def run(self):
|
||||||
"""execute pylint and fill the quickfix"""
|
"""execute pylint and fill the quickfix"""
|
||||||
|
|
||||||
|
if not pylint:
|
||||||
|
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,7 +46,7 @@
|
|||||||
|
|
||||||
let s:plugin_path = expand('<sfile>:p:h', 1)
|
let s:plugin_path = expand('<sfile>:p:h', 1)
|
||||||
|
|
||||||
if exists(":Pep8")
|
if exists(":Pylint")
|
||||||
finish " only load once
|
finish " only load once
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user