【问题标题】:How can I fix `flake8 D100 — Missing docstring` error in atom editor如何修复原子编辑器中的“flake8 D100 - Missing docstring”错误
【发布时间】:2017-09-13 08:28:13
【问题描述】:
我为 python 编程安装了 atom
并且还安装了 Linter 和 flake8
包,但我在文本编辑器中编写的所有内容都会收到此警告:
D100 — Missing docstring in public module
我已经试过了
pip uninstall flake8-docstrings
pip install Flake8-pep257
如何解决此警告?
【问题讨论】:
标签:
python
atom-editor
flake8
【解决方案1】:
它只不过是在你的程序顶部这样的评论。根据 Python 文档,它应该在每个函数和程序之前存在。这是一个简单的文档字符串代码
"""返回KOS根目录的路径名。"""
【解决方案2】:
您可以像任何 Atom 包一样通过编辑 Atom -> Preferences -> Packages -> linter-flake8 中的设置来配置 linter-flake8。
对您不想看到的任何错误使用“忽略错误代码”。
【解决方案3】:
从 atom 包存储中安装“linter-ui-default dependencies”。
它帮助了我..第一次无法安装。我重新启动了 Atom,它要求我安装这个包。单击是它已成功安装。现在我没有收到任何错误。