Fail CI on a rotted doc comment or link (#76) - #77
Merged
Conversation
Nothing here fails when a doc comment rots, and this is the crate where that costs most: its rustdoc is its contract. Two repositories link against it at a pinned revision and are written by quoting doc comments -- which accessors stay crate-private, that a parsed manifest is unauthenticated, why a footer block running past the footer is a truncated trailer, that one opener does not bound its envelope reads. Those comments are held together by 1009 intra-doc links across src. A rename breaks every link naming the old symbol, and a broken link renders as plain text, so the next reader sees a name that no longer resolves and cannot tell whether it moved, was renamed, or never existed. Once, where clippy runs twice. Clippy needs both runs because --all-targets covers every target but no feature. Documentation has no such gap: the crate carries no cfg(not(feature = ...)), so enabling test-support only adds items and one run covers a superset. The step passes on the current tree, so this adds a gate rather than a backlog, and it was proven to bite before landing: a scratch edit introducing an unresolved link fails the command. Closes #76
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.
Summary
Docsstep toci.yml'scheckjob:cargo doc --no-deps --document-private-items --features test-supportunderRUSTDOCFLAGS: -D warnings.checkruns formatting and clippy twice,testruns the suite twice, and there is nocargo docanywhere.aicers/bootler's CI has had the equivalent step since it had a CI.This crate is the one where that costs most, because its rustdoc is its contract.
aicers/bootlerandaicers/roxydboth link it at a pinned revision, and the decisions they are written against live in doc comments rather than in a specification — whichUnparsedContaineraccessors staypub(crate), thatparse_unverified_manifestreturns a manifest nothing has authenticated, thatinto_payloadtakes the manifest rather than parsing it, thatvalidate_footerreportsTruncatedTrailerfor a block running past the footer, thatopen_pathdoes not bound its envelope reads. Downstream issues are written by quoting those comments.They are held together by 1009 intra-doc links across
src/, 175 insrc/payload.rsalone. A broken link renders as plain text, so the failure is quiet and durable: the next reader sees a name that no longer resolves and cannot tell whether the symbol moved, was renamed, or never existed.Once, where clippy runs twice, and the comment beside the step says why. Clippy needs both runs because
--all-targetscovers every target but no feature. Documentation has no such gap: this crate carries no#[cfg(not(feature = ...))], so enablingtest-supportonly adds items and one run documents a superset of the default build.--document-private-itemsbecausevalidate_footer,envelope_present,Footerand thepub(crate)accessors are exactly where the reasoning lives, and a defaultcargo docskips them.No doc comment is edited, no
#![deny]/#![warn]attribute is added, and no existing step, job, trigger or toolchain declaration changes. Workflow only.Closes #76
Test plan
actionlint .github/workflows/ci.yml— clean.RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items --features test-supportpasses on this branch, with no doc comment changed, so this adds a gate rather than a backlog.Proven to bite rather than assumed to. A scratch edit added
/// See [NoSuchSymbolAnywhere] for the rules.aboveUnparsedContainer::signature, and the command failed:The edit was reverted; the diff is the workflow file alone.
git diff --statis.github/workflows/ci.yml | 15 +++++++++++++++— one file, additions only.This pull request's checks show the new
Docsstep running and green: thecheckjob reportsCheck formatting,Clippy,Clippy (test-support)andDocsall successful, and all four checks on the pull request pass.