Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Does yard stats generate docs like yard doc? #1445

Open
thomthom opened this issue Jun 17, 2022 · 2 comments
Open

Question: Does yard stats generate docs like yard doc? #1445

thomthom opened this issue Jun 17, 2022 · 2 comments

Comments

@thomthom
Copy link
Contributor

It appear that when I run yard stats --list-undoc the generated HTML output is also updated, like when I run yard doc.

Is this something that can be relied on? The reason is that I find it useful to see what isn't documented. Generating and providing a verbose description of what isn't documented all in one command is convenient.

But the CLI docs for yard stats says:

Prints documentation statistics on a set of files

Which to me kindof indicate that it should only print stats to the console. Generating HTML output at the same time sounds like an unintended side-effect with that wording.

@lsegal
Copy link
Owner

lsegal commented Jul 21, 2022

Sorry for missing this.

The stats command should not generate docs. This would be a bug if it actually works that way, but afaik this is not standard behavior. Could a plugin be interfering with the default command logic? If not, can you provide a minimal reproduction? I cannot seem to reproduce this on any codebase I have.

@thomthom
Copy link
Contributor Author

I checked again. and I think my original description wasn't entirely accurate. With a clean project, yard stats --list-undoc only generate .yardoc.

However, this Rake task will generate docs:

  YARD::Rake::YardocTask.new(:doc) do |task|
    task.stats_options << '--list-undoc'
  end

Since --list-undoc isn't a valid option for yard doc and this Rake task didn't yield a warning with task.stats_options << '--list-undoc' I thought it was calling yard stats when stats_options was used.

I'm guessing the YARD task is simply acting slightly different than the CLI command - allowing stats.

I actually like, and want, list of undocumented items when I generate the docs, so the current Rake task behaviour is a nice thing. (No option to return error exit code upon undocumented items?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants