如何在Pydev Eclipse编辑器边框中标记pylint警告? [英] How to get pylint warnings to be marked in the Pydev Eclipse editor margin?

查看:367
本文介绍了如何在Pydev Eclipse编辑器边框中标记pylint警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装pylint(在命令行上工作正常)并在Eclipse中设置Pydev。

I have pylint installed (works fine on the command line) and set up within Pydev in Eclipse.

当我编辑文件时,Pylint正在被触发,而且是输出到Eclipse控制台。

Pylint is being triggered OK when I edit files, and is outputting to the Eclipse console.

但是,pylint警告在编辑器边距中不会显示为标记(与编译器警告和错误相同)

But, the pylint warnings don't appear as marks in the editor margin (in the same way as compiler warnings and errors)

新生成的警告也不会显示在问题视图中 - 有一些旧的警告显示,但如果我重新保存相关模块,它们会消失。

Newly-generated warnings don't appear in the Problems view either - there are some old ones showing, but they disappear if I re-save the relevant module.

我知道这是可能的,因为我以前有工作 - 但是我如何设置这个?

I know this is possible as I've had it working previously - but how do I set this up?

提示或取消将Pylint输出重定向到控制台?似乎没有任何区别。

Ticking or unticking "Redirect Pylint output to console?" doesn't seem to make any difference.

推荐答案

今天我有一个全新的系统这个确切的问题。我跟踪了原因,似乎PyDev拒绝接收从2011年7月20日发布的pylint 0.24.0的消息。

I had this exact problem today, on a brand new system. I tracked down the cause, and it seems that PyDev refuses to pick up the messages from pylint 0.24.0, which was released on July 20, 2011.

恢复到以前的版本(pylint 0.23.0)似乎已经解决了这个问题。对于我来说,这涉及从Python的 Lib / site-packages 目录中删除与pylint相关的所有内容,然后运行 python setup.py install 从我提取pylint 0.23.0的目录中。 (不要在site-packages目录中删除这些文件,它会继续使用新版本。)但是,在这两个步骤之后,消息开始显示在PyDev中。

Reverting to the previous version (pylint 0.23.0) seems to have solved the problem. For me, that involved removing everything from Python's Lib/site-packages directory that was related to pylint, and then running python setup.py install from the directory I'd extracted pylint 0.23.0 into. (Without deleting those files in the site-packages directory first, it kept using the new version.) But after both those steps, the messages started showing up in PyDev as expected.

您可以从shell提示符中检查您的pylint版本与 pylint --version 如果显示0.23.0,那么你很好去。

You can check your pylint version with pylint --version from a shell prompt; if it shows 0.23.0 you're good to go.

这篇关于如何在Pydev Eclipse编辑器边框中标记pylint警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆