【问题标题】:How can I list the undocumented modules/classes/constants/methods with yardoc?如何使用 yardoc 列出未记录的模块/类/常量/方法?
【发布时间】:2011-08-11 01:04:55
【问题描述】:

我有一个小型代码库,我正在使用YARD 记录它。当我运行yardoc 命令时,它告诉我:

Files:          40
Modules:        14 (    0 undocumented)
Classes:        39 (    0 undocumented)
Constants:      21 (    4 undocumented)
Methods:       239 (   31 undocumented)
 88.82% documented

我希望它简单地列出未记录的项目,而不是遍历我的所有代码来查找未记录的常量和方法。有人知道怎么做吗?

【问题讨论】:

    标签: ruby documentation documentation-generation yard


    【解决方案1】:

    您可以使用--list-undoc 选项专门列出所有未记录的对象(及其文件位置)。

    yard stats --list-undoc
    

    甚至

    yard --list-undoc
    

    【讨论】:

    • 不错!该选项未在--help 输出中列出,当我使用它时,yardoc 说[warn]: Unrecognized/invalid option: --list-undoc - 但它仍然有效。谢谢!
    • 这不应该是公认的答案。 @Asher 更正确。
    • 谢谢,我已经更新了答案。但是,杰夫,如果您愿意,请随时重新接受答案。
    【解决方案2】:

    这也让我感到困惑。 --list-undoc 选项实际上是在stats 命令下定义的。此外,该命令是yard,而不是yardoc,后者是yard doc 的简写。

    yard stats --list-undoc
    

    【讨论】:

    • 作为参考,它实际上是“yard stats --list-undoc”而不是yardoc。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-12
    • 2020-02-09
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    • 2018-12-10
    • 2019-04-14
    相关资源
    最近更新 更多