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

Enhance documentation & enforce 100% coverage #743

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nitishr
Copy link
Contributor

@nitishr nitishr commented Feb 21, 2025

Closes #707.

Several improvements focused on documentation:

  • A new Rake task docs:coverage extracts the documented percentage from yard stats and fails the build if it is below the specified level (currently set to 100%).
  • CircleCI configuration runs the new docs:coverage task after generating YARD docs. Disables frozen string literals for the documentation generation step to prevent YARD throwing FrozenError.
  • Additional source files (lib/mocha.rb and lib/mocha/integration.rb) are part of the generated documentation.
  • Inline documentation in lib/mocha.rb provides an overview of the API, the mocking methods, and integration hooks.
  • The Integration module and the Adapters under it include module-level comments to clarify their purpose.

disable-frozen-string-literal for the docs command else YARD throws
[error]: FrozenError: can't modify frozen String: ""
@floehopper floehopper requested review from floehopper and removed request for floehopper February 23, 2025 14:49
@floehopper
Copy link
Member

Thanks again for all your work! See my comments inline below.

Closes #707.

Several improvements focused on documentation:

* A new Rake task `docs:coverage` extracts the documented percentage from yard stats and fails the build if it is below the specified level (currently set to 100%).

The "Extend, Extend, Extend!" section of the YARD docs now mentions yardstick for checking documentation quality & coverag, so perhaps we can use that to simplify this code?

The introduction of a docs namespace makes sense, but perhaps we should move the existing doc-related tasks into that namespace. Also it might be time to extract some separate *.rake tasks...? This isn't essential for this PR - it could be done in a follow-up PR.

* CircleCI configuration runs the new docs:coverage task after generating YARD docs. Disables frozen string literals for the documentation generation step to prevent YARD throwing FrozenError.

We might need to remember to remove the disabling of frozen string literals when #741 is merged.

* Additional source files (`lib/mocha.rb` and `lib/mocha/integration.rb`) are part of the generated documentation.

* Inline documentation in `lib/mocha.rb` provides an overview of the API, the mocking methods, and integration hooks.

* The `Integration` module and the `Adapter`s under it include module-level comments to clarify their purpose.

All this new documentation looks great - thank you! ❤️

@floehopper
Copy link
Member

Also I'd like to be sure we fail if there are warnings or errors when generating docs.

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

Successfully merging this pull request may close these issues.

Consider adding some kind of documentation coverage check
2 participants