docs: complete the YARD tags on connection and run_command - #499
Merged
Conversation
`Transport::Docker#connection` accepts a block but only documented its `state` argument, so the block was missing from the generated signature. Document it as what it is: a proc forwarded to the connection's constructor, which yields the new connection to it without closing it. `CliHelper#run_command` documented its `@raise` as `Kitchen::ShellCommandFailed`, which is not a class that exists. The bare `ShellCommandFailed` the method raises resolves through the included `Kitchen::ShellOut` mixin to `Kitchen::ShellOut::ShellCommandFailed`, so the tag rendered as an unlinked literal instead of a link to the real class. Comments only; no behaviour change. Signed-off-by: Tim Smith <tim@mondoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two documentation tag fixes found by auditing every method in
lib/against its real signature.yard statsalready reports 100.00% documented, but that number counts any docstring at all, so it does not catch a tag that is missing or a tag that names a class which does not exist. Auditing the parsed registry instead of the coverage percentage turns those up.Transport::Docker#connectionwas missing@param blockThe method is
def connection(state, &block), but onlystatewas documented, so the block did not appear in the generated signature. It is now documented as what it actually is: a proc forwarded toConnection.new, which yields the new connection to it. Worth stating explicitly that the connection is not closed when the block returns —Kitchen::Transport::Base::Connection#initializeonly doesyield self if block_given?.CliHelper#run_commandnamed a class that does not existThe tag read
@raise [Kitchen::ShellCommandFailed]. There is no such constant:The method raises a bare
ShellCommandFailed, which resolves through theinclude ShellOutinCliHelpertoKitchen::ShellOut::ShellCommandFailed:A type name that does not resolve renders as plain text rather than a link, so the tag pointed nowhere.
Verification
Auditing all 91 methods in the
.yardoptsscope (which includes--private --protected) for parameters absent from the@paramtags:yardemits no warnings before or after.lib/was also swept for the other shapes of bad type name —Array[T]where YARD spells a listArray<T>,Hash[...]where it wantsHash{K => V}, and namespaced constants whose casing does not match the real class.Kitchen::ShellCommandFailedwas the only hit; every other referenced constant resolves.The
docanddoc_coveragerake tasks already existed and still run clean.Comments only — no behaviour change, and the test count is unchanged.