lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.95k stars 398 forks source link

Running yardoc after deleting/moving a class does not remove the generated HTML file for that class #1417

Closed sam-carlberg closed 2 years ago

sam-carlberg commented 2 years ago

Steps to reproduce

Tested and reproduced in both a large legacy project and in a small proof-of-concept project

This is the minimal reproduction for the issue. I've done my best to remove all extraneous code and unique environment state on my machine before providing these steps:

  1. Create a new class (echo "class Foo; end" > lib/foo.rb)
  2. Run yardoc to generate documentation for the new class
  3. Observe doc/Foo.html was created
  4. Delete the class (rm lib/foo.rb)
  5. Run yardoc again
  6. Observe doc/Foo.html still exists

Actual Output

doc/Foo.html still persists lib/foo.rb is removed from .yardoc/checksums Foo is removed from the class list on the index page

Expected Output

doc/Foo.html should be deleted lib/foo.rb is removed from .yardoc/checksums Foo is removed from the class list on the index page

Environment details:

I have read the Contributing Guide.

lsegal commented 2 years ago

This is expected behavior. In order to avoid making any dangerous unrecoverable mistakes with your filesystem, YARD will never remove files in the output directory.

If you're rerunning YARD generation, it's up to you to clear the directory beforehand if that is required.

sam-carlberg commented 2 years ago

Thanks for the clarification @lsegal