python - 用于 Sphinx/readthedocs 的 Google 样式文档字符串的样式指南检查?
问题描述
我们正在使用 Sphinx v3 构建文档,并使用 sphinx.ext.napoleon 和 Google 样式的文档字符串阅读文档。当我们在本地构建时,Sphinx 不会捕获格式错误的 Google 文档字符串作为警告。例如:
"""
This should go next to the triple quotes above.
Args: there should be nothing here
sample_arg (int): there also shouldn't be anything here
Some documentation that is missing a tab at the beginning.
Missing return
"""
使用 本地构建make html
,这不会引发任何警告,但可怕地搞砸了它在 readthedocs 上的显示方式。我们sphinx.ext.napoleon
在conf.py
extensions
变量中添加并保持原始 Makefile 不变,除了-W --keep-going -a -E
在SPHINXOPTS
.
make build
如果有人试图使用糟糕的 Google 风格的文档运行,有没有办法让 Sphinx 构建失败?还是我们必须忍受手动查看和识别这些错误?
解决方案
推荐阅读
- sparql - SPARQL 查询结构中的第 n 个节点
- c# - 创建对象的递归列表 C#
- python - 如何启动从 Python 调用的 C++ 的 GDB?
- r - 在`dplyr`中操作动态创建的变量名
- caching - 缓存一致性(物理标记的缓存的特殊情况)
- c++ - 如何在 Linux 上正确发布 C++ 软件(游戏)
- java - 如何按属性对 HashMap 进行排序
- html - 我可以在上传到 WordPress 之前预览/运行我的 CSS 和 HTML 代码吗?
- python-3.x - 无法使用带有 Python 的 office365 从 SharePoint 读取 Excel
- sql-server - 如何使用 SQL Server Manangement Studio 更新和替换插入新的 xml 元素