PyCharm 3的PEP8代码风格警告提示信息
2015-11-16 11:07
786 查看
PyCharm好心的PEP8提示却有碍代码观感,怎样才能关闭我不需要的警告信息呢?
通过Google发现了如下信息:
In
pycharm, click the settings icon, or go to the settings via the menu bar.
In the project settings section, click ‘inspections’
In the list that appears, click ‘python’.
Under python, scroll down and click PEP8.
Now, underneath the description, you’ll se an ‘ignore errors’ section. Click the + at the bottom.
Now, go here.
This is a page of the pep8.py documentation, listing all possible errors and warnings.
Find an error you want to ignore, and copy the error code at the left.
Paste this error code into the field you just added in the settings window.
Add all the errors you want to ignore and click apply.
主要是在PyCharm项目设置中找到
只要取消掉PEP8风格警告和校验警告即可:
后来JetBrains的开发者Dmitry
Jemerov与作者联系提供了一个更为简便的办法,那就是点击要忽略的错误所在,然后按Alt+Enter,在弹出下拉菜单选择
通过Google发现了如下信息:
In
pycharm, click the settings icon, or go to the settings via the menu bar.
In the project settings section, click ‘inspections’
In the list that appears, click ‘python’.
Under python, scroll down and click PEP8.
Now, underneath the description, you’ll se an ‘ignore errors’ section. Click the + at the bottom.
Now, go here.
This is a page of the pep8.py documentation, listing all possible errors and warnings.
Find an error you want to ignore, and copy the error code at the left.
Paste this error code into the field you just added in the settings window.
Add all the errors you want to ignore and click apply.
主要是在PyCharm项目设置中找到
inspections选项,然后找到
PEP 8 coding style violation,在右边的ignore errors,点击下面的加号,添加要忽略的警告信息编码,这个编码可以参考PEP8.py的官方网站,如下图所示我添加了E221、E401、E203这几个要忽略的信息。
只要取消掉PEP8风格警告和校验警告即可:
后来JetBrains的开发者Dmitry
Jemerov与作者联系提供了一个更为简便的办法,那就是点击要忽略的错误所在,然后按Alt+Enter,在弹出下拉菜单选择
ignore errors like this,就可以快速忽略了。
相关文章推荐
- spring事务
- Java运算符
- Java for Web学习笔记(八):Servlet(6)doGet()和doPost()是线程还是队列
- NOIP2015复赛题解报告答案以及代码
- 解决eclipse在线安装不了genymotion
- eclipse 编码设置/JSP include出现乱码
- 现在写 PHP,你应该知道这些
- 常用的一些性能/自动化工具(lr,jmeter,QTP,)
- Qt 多线程示例
- 改善Java程序的151个建议--记录(持续更新)
- 在eclipseAndroid之打包生成apk
- 25个让Java程序员更高效的Eclipse插件
- Spring获取资源文件
- PHP扩展代码结构详解
- PHP 7 的几个新特性
- Java多线程基础
- Java Timer和TimerTask实例教程
- ASP.NET 大文件上传
- PHP利用openoffice实现文档装换
- Codeforces 598D:Igor In the Museum