yard
yard copied to clipboard
Spurious warning with `list-undoc` and `compact` options
Steps to reproduce
yard doc --list-undoc --compact
Actual Output
[warn]: Unrecognized/invalid option: --list-undoc
[warn]: Unrecognized/invalid option: --compact
However, the output includes undocumented nodes in compact fashion. (I noticed that both opts are listed in lib/yard/cli/stats.rb but not lib/yard/cli/yardoc.rb)
Expected Output
There should not be warnings for these valid options in the output
Environment details:
- OS: macos catalina
- Ruby version (
ruby -v): ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19] - YARD version (
yard -v): yard 0.9.25
I have read the Contributing Guide.
You want to be using yard stats for this. Although using doc works, that's an implementation detail and not supported by the command as correctly denoted by the warnings.
Thanks for the quick reply, I’ll investigate further. Is it possible to organize .yardopts by cli command to avoid these warnings? Is it possible to bundle doc and stats as a single output?
@dduugg can you elaborate on the use case for bundling output? Also you can use --yardopts FILE to select a different .yardopts depending on the tool, but YARD does not pick automatically.
Ok, got it, I can work with that. The separation of concerns is maybe a bit non-intuitive here though. Since the output of yard doc includes stats, e.g.
Files: 27
Modules: 9 ( 0 undocumented)
Classes: 18 ( 1 undocumented)
Constants: 4 ( 0 undocumented)
Attributes: 3 ( 0 undocumented)
Methods: 45 ( 2 undocumented)
96.20% documented
…it's a bit surprising asking for a list of the undocumented nodes in the same output is unsupported.
Thanks again for the quick replies, and for this contribution to OSS.