Skip to content

docs: reach 100% YARD coverage and add doc rake tasks - #57

Merged
tas50 merged 1 commit into
mainfrom
docs/complete-yard-coverage
Aug 23, 2026
Merged

docs: reach 100% YARD coverage and add doc rake tasks#57
tas50 merged 1 commit into
mainfrom
docs/complete-yard-coverage

Conversation

@tas50

@tas50 tas50 commented Aug 23, 2026

Copy link
Copy Markdown
Member

What

Measured with --private, kitchen-cloudstack was at 65% — 22 of 44 methods, four constants, and the Kitchen::Driver namespace undocumented — with no way to generate or measure docs.

  • Everything remaining documented → 100%.
  • .yardopts added as the single source of truth.
  • rake doc and rake doc_coverage added; yard in a :docs bundle group.

Two things worth calling out

create, destroy, and status had # (see Base#create) directives. YARD doesn't count those as documentation, and more importantly they told a reader nothing about what this driver does differently — destroy tears down the public address, port forward, and firewall rule before the instance and then scrubs credentials from the state file; status maps CloudStack's own state names onto Test Kitchen's live/not-live. They now have real docstrings, and the stranded directives are removed rather than left sitting above the new prose.

The four undocumented constants shared one comment. JOB_SUCCEEDED, JOB_FAILED, DEFAULT_POLL_INTERVAL, and DEFAULT_TIMEOUT sat beneath a comment that YARD attached only to JOB_RUNNING:

# Values CloudStack reports in an async job's "jobstatus" field.
JOB_RUNNING = 0
JOB_SUCCEEDED = 1   # <- undocumented as far as YARD is concerned
JOB_FAILED = 2      # <- likewise

Each now carries its own, and the two DEFAULT_* constants name the config option that overrides them.

Verification

$ yard stats --private --protected
Modules:         2 (    0 undocumented)
Classes:         5 (    0 undocumented)
Constants:      15 (    0 undocumented)
Attributes:     11 (    0 undocumented)
Methods:        44 (    0 undocumented)
 100.00% documented
$ bundle exec rspec
63 examples, 0 failures

$ bundle exec cookstyle --chefstyle lib
6 files inspected, no offenses detected

Comments only — no behaviour change.

🤖 Generated with Claude Code

kitchen-cloudstack was at 65% under --private: 22 of 44 methods, four
constants, and the Kitchen::Driver namespace were undocumented, and there
was no way to generate or measure docs.

Document the rest and add .yardopts plus `rake doc` / `rake doc_coverage`.

create, destroy, and status carried `# (see Base#create)` reference
directives, which YARD does not count as documentation and which told a
reader nothing about what this driver does differently -- destroy tearing
down the public address before the instance, status mapping CloudStack's
own state names. They now have real docstrings and the stranded
directives are gone.

The four undocumented constants were JOB_SUCCEEDED, JOB_FAILED, and both
DEFAULT_* timeouts. They sat under a comment attached only to
JOB_RUNNING, so each now carries its own.

Comments only. Verified with 63 examples, 0 failures and cookstyle clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tas50
tas50 merged commit 0ff969f into main Aug 23, 2026
8 checks passed
@tas50
tas50 deleted the docs/complete-yard-coverage branch August 23, 2026 04:51
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.

1 participant