0

我正在尝试将 linter 添加到 repo 中,以强制执行参数的文档字符串文档并返回函数和方法的值,如Google Python Style Guide中所述。

一般来说,我想强制执行以下文档字符串内容:

def blah(n: int) -> int:
    """
    Args:
        n: a number
    
    Returns:
        The number plus 1
    """
    return n+1

我查看了谷歌自己的 Python 格式化工具YAPF,但找不到配置参数和返回值。对这个主题进行更广泛的搜索并没有产生任何结果。

如何使用 linter 在文档字符串中强制执行参数和返回值文档?

4

0 回答 0