mirror of
https://github.com/gryf/pylint-vim.git
synced 2026-04-25 23:31:23 +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 re
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
try:
|
||||
from pylint import lint
|
||||
from pylint.reporters.text import TextReporter
|
||||
except ImportError:
|
||||
raise AssertionError('Error: pylint_fm.vim requires module pylint')
|
||||
lint = None
|
||||
|
||||
import vim
|
||||
|
||||
@@ -25,6 +28,10 @@ class VImPylint(object):
|
||||
def run(self):
|
||||
"""execute pylint and fill the quickfix"""
|
||||
|
||||
if not lint:
|
||||
vim.command("echo 'Error: pylint_fm.vim requires module pylint'")
|
||||
return
|
||||
|
||||
# clear QF window
|
||||
vim.command('call setqflist([])')
|
||||
|
||||
|
||||
@@ -46,10 +46,8 @@
|
||||
|
||||
let s:plugin_path = expand('<sfile>:p:h', 1)
|
||||
|
||||
if exists("b:did_pylint_plugin")
|
||||
if exists(":Pylint")
|
||||
finish " only load once
|
||||
else
|
||||
let b:did_pylint_plugin = 1
|
||||
endif
|
||||
|
||||
function! s:SetPython(msg)
|
||||
|
||||
Reference in New Issue
Block a user