Python Eclipse代码分析忽略似乎没有

2024-06-25 23:07:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我在PyDev中使用Eclipse。我需要对Pep8做一些调整。我一直在胡思乱想,认为自己取得了一些进展,但我真的不知道这是怎么回事。在

当前的问题是,我希望在与pep8缩进不匹配时停止出现PyDev警告。我用2个空格代替4个空格。奇怪的是我并不是每件事都有。似乎我在某些地方成功地关闭了它们,但其他地方没有。我想关闭E121。我有一个派林特档案。在

  1. 我尝试过在PYDev->;编辑器->;代码分析设置中使用--ignore。在
  2. 我尝试过关闭/打开PyDev->;Editor->;CodeStyle->;CodeFormatter。在
  3. 我尝试过右键单击容器文件夹并执行PyDev->;RemoveErrorMarkers,但当分析再次运行时,它们又回来了。在

我还能试试什么?我怎样才能缩小范围呢?有人能告诉我这是怎么回事吗?在

感谢任何帮助。谢谢。在


Tags: 代码gt警告地方档案编辑器editorignore
1条回答
网友
1楼 · 发布于 2024-06-25 23:07:31

我已经使用设置.cfg我的项目中的文件。它与src文件夹并行,包含以下内容:

[pep8]
max-line-length=100
# pep8 1.6.2 wants all includes at the top:
ignore=E402

这样,即使在命令行上或从任何其他编辑器中使用pep8,也可以获得预期的结果。您必须更改ignore行以匹配要禁止显示的错误代码。在

请参见pep8帮助的输出:

Configuration: The project options are read from the [pep8] section of the tox.ini file or the setup.cfg file located in any parent folder of the path(s) being processed. Allowed options are: exclude, filename, select, ignore, max-line-length, hang-closing, count, format, quiet, show- pep8, show-source, statistics, verbose.

相关问题 更多 >