- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
所以我开始使用 Pylint,但是因为我使用的是制表符而不是空格,所以它给我作为警告,也因为一些方法来自基类,这也是因为 'GalleryUi' 的实例没有 'setModel' 成员,而它有 QAbstractTableModel 作为基类,所以我如何设置 Pylint 不考虑这些事情...
No config file found, using default configuration
************* Module python.gallery
W: 7, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 8, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 13, 0: Trailing whitespace (trailing-whitespace)
C: 15, 0: Trailing whitespace (trailing-whitespace)
W: 15, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 16, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 17, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 18, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 19, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 20, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 22, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 23, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 24, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 25, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 27, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 28, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 28, 0: Trailing whitespace (trailing-whitespace)
W: 31, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 32, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 33, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 34, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 36, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 37, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 39, 0: Trailing whitespace (trailing-whitespace)
W: 39, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 41, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 42, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 44, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 46, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 47, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 49, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 50, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 52, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 53, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 55, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 56, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 58, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 59, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 60, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 61, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 62, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 63, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 64, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 65, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 67, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 68, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 69, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 70, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 71, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 72, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 73, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 74, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 75, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 77, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 78, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 79, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 80, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 81, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 82, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 83, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 85, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 87, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 88, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 89, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 90, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 91, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 92, 0: Trailing whitespace (trailing-whitespace)
W: 92, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 95, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W: 96, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 99, 0: Line too long (88/80) (line-too-long)
W: 99, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:101, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:102, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C:102, 0: Trailing whitespace (trailing-whitespace)
W:105, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:106, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:107, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:108, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:109, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:111, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:112, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:113, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:114, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:115, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:116, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:117, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:120, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:123, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:124, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:125, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:126, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:127, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:128, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:129, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:131, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:132, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:135, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:136, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:137, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:138, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:139, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:140, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C:142, 0: Trailing whitespace (trailing-whitespace)
C:145, 0: Trailing whitespace (trailing-whitespace)
W:145, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:146, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:147, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:148, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:149, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C:150, 0: Trailing whitespace (trailing-whitespace)
W:150, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:152, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:153, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:154, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:155, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:156, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:157, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:159, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:160, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:161, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:162, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:164, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:165, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:168, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:169, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:173, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:174, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:175, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:175, 0: Unnecessary semicolon (unnecessary-semicolon)
W:176, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:178, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:179, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:180, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:181, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:182, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:185, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:186, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:188, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:189, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:189, 0: Unnecessary semicolon (unnecessary-semicolon)
W:190, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C:191, 0: Trailing whitespace (trailing-whitespace)
W:191, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:193, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:195, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:196, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:199, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:200, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:201, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:202, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:203, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:204, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:205, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:206, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:209, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:211, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:212, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:213, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:214, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C:215, 0: Trailing whitespace (trailing-whitespace)
W:217, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:218, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:219, 0: Found indentation with tabs instead of spaces (mixed-indentation)
W:220, 0: Found indentation with tabs instead of spaces (mixed-indentation)
C: 1, 0: Missing module docstring (missing-docstring)
W: 3, 0: Relative import 'utils', should be 'python.utils' (relative-import)
F: 4, 0: Unable to import 'PyQt4' (import-error)
C: 17, 2: Invalid attribute name "_thumbRes" (invalid-name)
C: 16, 2: Invalid attribute name "_slideShowWin" (invalid-name)
C: 6, 0: Missing class docstring (missing-docstring)
R: 7, 1: Too many arguments (6/5) (too-many-arguments)
C: 7, 1: Invalid argument name "thumbRes" (invalid-name)
C: 22, 1: Invalid method name "colData" (invalid-name)
C: 22, 1: Missing method docstring (missing-docstring)
W: 22,19: Unused argument 'section' (unused-argument)
W: 22,28: Unused argument 'orientation' (unused-argument)
R: 22, 1: Method could be a function (no-self-use)
C: 27, 1: Invalid method name "headerData" (invalid-name)
W: 27,22: Unused argument 'section' (unused-argument)
R: 27, 1: Method could be a function (no-self-use)
C: 36, 1: Invalid method name "rowCount" (invalid-name)
W: 36,20: Unused argument 'parent' (unused-argument)
C: 41, 1: Invalid method name "columnCount" (invalid-name)
W: 41,23: Unused argument 'parent' (unused-argument)
C: 62, 4: Invalid variable name "fileName" (invalid-name)
C: 71, 4: Invalid variable name "fileName" (invalid-name)
C: 74, 3: Invalid variable name "exifData" (invalid-name)
R: 46, 1: Too many return statements (9/6) (too-many-return-statements)
W: 95,17: Unused argument 'index' (unused-argument)
R: 95, 1: Method could be a function (no-self-use)
C:101, 1: Invalid method name "setData" (invalid-name)
C:109, 4: Invalid variable name "newName" (invalid-name)
W:113, 3: Access to a protected member _renameFile of a client class (protected-access)
E:115, 3: Instance of 'MyListModel' has no 'dataChanged' member (no-member)
R:119, 0: Too many instance attributes (8/7) (too-many-instance-attributes)
C:188, 2: Invalid attribute name "animGallery" (invalid-name)
C:128, 2: Invalid attribute name "__animRate" (invalid-name)
C:146, 2: Invalid attribute name "_twoDLst" (invalid-name)
C:125, 2: Invalid attribute name "_slideShowWin" (invalid-name)
E:123, 1: Use of super on an old style class (super-on-old-class)
C:123, 1: Invalid argument name "imgagesPathLst" (invalid-name)
C:131, 1: Invalid method name "setUpWindow" (invalid-name)
W:136,10: Access to a protected member _browseDir of a client class (protected-access)
E:140, 2: Instance of 'GalleryUi' has no 'setWindowFlags' member (no-member)
E:147, 2: Instance of 'GalleryUi' has no 'setGeometry' member (no-member)
E:148, 2: Instance of 'GalleryUi' has no 'showFullScreen' member (no-member)
E:149, 2: Instance of 'GalleryUi' has no 'setColumnWidth' member (no-member)
E:152, 2: Instance of 'GalleryUi' has no 'setShowGrid' member (no-member)
E:153, 2: Instance of 'GalleryUi' has no 'setWordWrap' member (no-member)
E:154, 2: Instance of 'GalleryUi' has no 'setModel' member (no-member)
E:155, 2: Instance of 'GalleryUi' has no 'resizeColumnsToContents' member (no-member)
E:156, 2: Instance of 'GalleryUi' has no 'resizeRowsToContents' member (no-member)
E:157, 2: Instance of 'GalleryUi' has no 'selectionModel' member (no-member)
C:159, 1: Invalid method name "selChanged" (invalid-name)
C:159, 1: Missing method docstring (missing-docstring)
E:161, 9: Instance of 'GalleryUi' has no 'selectionModel' member (no-member)
E:162,12: Instance of 'GalleryUi' has no 'selectionModel' member (no-member)
C:168, 1: Invalid method name "animateUpSlideShow" (invalid-name)
C:185, 1: Invalid method name "animateUpGallery" (invalid-name)
C:195, 1: Invalid method name "keyPressEvent" (invalid-name)
E:203, 3: Instance of 'GalleryUi' has no 'close' member (no-member)
W:174, 2: Attribute 'animation' defined outside __init__ (attribute-defined-outside-init)
W:188, 2: Attribute 'animGallery' defined outside __init__ (attribute-defined-outside-init)
W:146, 2: Attribute '_twoDLst' defined outside __init__ (attribute-defined-outside-init)
W:150, 2: Attribute '_lm' defined outside __init__ (attribute-defined-outside-init)
C:208, 0: Invalid argument name "imgLst" (invalid-name)
E:213, 1: Instance of 'GalleryUi' has no 'raise_' member (no-member)
C:217, 1: Invalid constant name "current_path" (invalid-name)
C:219, 2: Invalid constant name "current_path" (invalid-name)
最佳答案
您可以使用 ~/.pylintrc
文件来配置 Pylint - 除其他外,这允许您忽略您不关心的警告。如果必须使用制表符,请通过将 indent-string
选项设置为制表符来告诉 Pylint:
[FORMAT]
indent-string=\t
然后,Pylint 只会警告您混合制表符和空格的地方——您永远不应该这样做,并在您的代码中留意。
要禁用其他警告,请使用 Message Control 单独关闭它们:
[MESSAGES CONTROL]
# C0111: Missing docstring
# R0904: Too many public methods
disable=C0111,R0904
要获取您感兴趣的消息的 ID,请查看 Pylint 报告的“消息”部分,或查看 http://pylint-messages.wikidot.com/all-codes。
另请参阅 Pylint 文档中的 Message Control 部分,以及 How to find the option name for .pylintrc
corresponding to a specific command line option 上的相应常见问题解答条目。
我真的建议使用 .pylintrc
,但为了完整起见,您的其他选择是:
#pylint: disable=W0123,E4567
pylint --disable=W0702,C0103
关于python - 使用 Pylint 显示错误和警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20639173/
我正在处理一组标记为 160 个组的 173k 点。我想通过合并最接近的(到 9 或 10 个组)来减少组/集群的数量。我搜索过 sklearn 或类似的库,但没有成功。 我猜它只是通过 knn 聚类
我有一个扁平数字列表,这些数字逻辑上以 3 为一组,其中每个三元组是 (number, __ignored, flag[0 or 1]),例如: [7,56,1, 8,0,0, 2,0,0, 6,1,
我正在使用 pipenv 来管理我的包。我想编写一个 python 脚本来调用另一个使用不同虚拟环境(VE)的 python 脚本。 如何运行使用 VE1 的 python 脚本 1 并调用另一个 p
假设我有一个文件 script.py 位于 path = "foo/bar/script.py"。我正在寻找一种在 Python 中通过函数 execute_script() 从我的主要 Python
这听起来像是谜语或笑话,但实际上我还没有找到这个问题的答案。 问题到底是什么? 我想运行 2 个脚本。在第一个脚本中,我调用另一个脚本,但我希望它们继续并行,而不是在两个单独的线程中。主要是我不希望第
我有一个带有 python 2.5.5 的软件。我想发送一个命令,该命令将在 python 2.7.5 中启动一个脚本,然后继续执行该脚本。 我试过用 #!python2.7.5 和http://re
我在 python 命令行(使用 python 2.7)中,并尝试运行 Python 脚本。我的操作系统是 Windows 7。我已将我的目录设置为包含我所有脚本的文件夹,使用: os.chdir("
剧透:部分解决(见最后)。 以下是使用 Python 嵌入的代码示例: #include int main(int argc, char** argv) { Py_SetPythonHome
假设我有以下列表,对应于及时的股票价格: prices = [1, 3, 7, 10, 9, 8, 5, 3, 6, 8, 12, 9, 6, 10, 13, 8, 4, 11] 我想确定以下总体上最
所以我试图在选择某个单选按钮时更改此框架的背景。 我的框架位于一个类中,并且单选按钮的功能位于该类之外。 (这样我就可以在所有其他框架上调用它们。) 问题是每当我选择单选按钮时都会出现以下错误: co
我正在尝试将字符串与 python 中的正则表达式进行比较,如下所示, #!/usr/bin/env python3 import re str1 = "Expecting property name
考虑以下原型(prototype) Boost.Python 模块,该模块从单独的 C++ 头文件中引入类“D”。 /* file: a/b.cpp */ BOOST_PYTHON_MODULE(c)
如何编写一个程序来“识别函数调用的行号?” python 检查模块提供了定位行号的选项,但是, def di(): return inspect.currentframe().f_back.f_l
我已经使用 macports 安装了 Python 2.7,并且由于我的 $PATH 变量,这就是我输入 $ python 时得到的变量。然而,virtualenv 默认使用 Python 2.6,除
我只想问如何加快 python 上的 re.search 速度。 我有一个很长的字符串行,长度为 176861(即带有一些符号的字母数字字符),我使用此函数测试了该行以进行研究: def getExe
list1= [u'%app%%General%%Council%', u'%people%', u'%people%%Regional%%Council%%Mandate%', u'%ppp%%Ge
这个问题在这里已经有了答案: Is it Pythonic to use list comprehensions for just side effects? (7 个答案) 关闭 4 个月前。 告
我想用 Python 将两个列表组合成一个列表,方法如下: a = [1,1,1,2,2,2,3,3,3,3] b= ["Sun", "is", "bright", "June","and" ,"Ju
我正在运行带有最新 Boost 发行版 (1.55.0) 的 Mac OS X 10.8.4 (Darwin 12.4.0)。我正在按照说明 here构建包含在我的发行版中的教程 Boost-Pyth
学习 Python,我正在尝试制作一个没有任何第 3 方库的网络抓取工具,这样过程对我来说并没有简化,而且我知道我在做什么。我浏览了一些在线资源,但所有这些都让我对某些事情感到困惑。 html 看起来
我是一名优秀的程序员,十分优秀!