Adopt the Whitaker Dylint suite in the lint gate and CI - #20
Conversation
The lint gate had accumulated failures against the pinned nightly toolchain and the strict Clippy configuration, and the Whitaker Dylint suite surfaced further findings. Clear both so the gate can be tightened: - Replace `#[tokio::main]` with an explicitly built runtime so runtime construction failures propagate as errors rather than panicking via the macro's internal `expect` (no_expect_outside_tests). - Replace `eprintln!` with a stderr `writeln!` helper that propagates write failures (clippy::print_stderr). - Read documentation HTML through a `cap_std::fs::Dir` capability handle scoped to the docs root instead of ambient `std::fs` calls (no_std_fs_operations); drop the now-unneeded file-path parse wrappers. - Remove dead code: `ParseError::InvalidHtml`/`MissingElement`, `SummaryError::RateLimited` (the retry loop now applies plain exponential backoff), `ItemKind::AttrMacro`/`DeriveMacro`, `ItemEntry::kind`, `Summarizer::with_model`, and the unused `extract_title`/`extract_docblock` helpers. - Wire previously unread data into the summary output: type aliases, constants, and macros sections; item kind labels in detailed headings; method signatures; and struct field and enum variant name lists (fields and variants are now plain name vectors, replacing the never-populated `FieldDoc`/`VariantDoc` structs). - Convert `match`-on-`Option` blocks to `let ... else`, split `format_docs_summary`, `convert_links`, `extract_zip`, and `extract_items` into focused helpers, and share the section-name scanner between struct fields and enum variants. This also brings `parser/item.rs` back under the 400-line module limit. - Build summary strings with `push_str` instead of appending `format!` output (clippy::format_push_string). - Rename shadowed bindings, remove needless raw-string hashes, add missing backticks in docs, and give every test module an inner doc comment (module_must_have_inner_docs). - Wrap over-long README lines, label bare fenced code blocks, and fix list spacing so `make markdownlint` passes.
Run the Whitaker Dylint suite after Clippy in `make lint`, with warnings denied, so the estate-wide lint policy is enforced locally and in CI. The `WHITAKER` variable follows the existing tool-variable convention and defaults to the `whitaker` wrapper installed by whitaker-installer. In CI, install whitaker-installer 0.2.5 before the lint step, using `cargo binstall` when available and falling back to building from crates.io otherwise, and cache the installer binary and the cargo-binstall download cache keyed on OS, architecture, and installer version. Part of the estate-wide Whitaker rollout; see leynos/netsuke#410 for the reference adoption.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 59 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Replace inline `${{ env.WHITAKER_INSTALLER_VERSION }}` interpolation in the
run block with the plain shell variable `"${WHITAKER_INSTALLER_VERSION}"`;
the job-level `env:` already exports it, and zizmor flags run-block template
interpolation as a template-injection hazard. Add `--locked` to the
cargo-binstall invocation so that binstall's compile fallback resolves
dependencies from the published lockfile, keeping fallback builds
reproducible.
Summary
This pull request adopts the Whitaker Dylint suite (v0.2.5) in the
lintgate and in CI, as part of the estate-wide rollout tracked by the reference
adoption in leynos/netsuke#410.
The lint gate had accumulated failures against the pinned nightly toolchain
and the repository's strict Clippy configuration, so the first commit clears
that debt before the gate is tightened:
propagate as errors instead of panicking inside the
#[tokio::main]expansion, and the missing-API-key warning is written via a fallible
stderr helper rather than
eprintln!.cap_std::fs::Dircapability handlescoped to the documentation root, replacing ambient
std::fscalls.ParseError::InvalidHtml/MissingElement,SummaryError::RateLimited,ItemKind::AttrMacro/DeriveMacro,ItemEntry::kind,Summarizer::with_model, and unused Markdown helpers),and previously unread data — type aliases, constants, macros, item kind
labels, method signatures, and struct field and enum variant names — is
wired into the summary output instead.
format_docs_summary,convert_links,extract_zip,extract_items) are decomposed into focused helpers,match-on-Optionblocks become
let ... else, string building usespush_strrather thanappending
format!output, and every test module gains an inner doccomment.
parser/item.rsreturns beneath the 400-line module limit.list spacing, double blanks) are fixed so
make markdownlintpasses.The second commit wires the suite in:
make lintrunsRUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS)afterClippy, and CI installs whitaker-installer 0.2.5 (via
cargo binstall,falling back to
cargo installwhen binstall is unavailable) with theinstaller binary and binstall cache keyed on OS, architecture, and version.
No
dylint.tomlexclusions were required; the suite passes cleanly.Review walkthrough
Makefileadds the
WHITAKERtool variable and appends the suite to thelinttarget.
.github/workflows/ci.ymladds the installer version, cache, and install steps ahead of the lint
step.
src/main.rsbuilds the runtime explicitly and warns via
writeln!.src/parser/mod.rsopens a capability handle for the docs root and hosts the decomposed
summary formatter.
src/parser/index.rsand
src/parser/item.rslose dead variants and structs and share the section-name scanner.
src/error.rsand
src/summarizer.rsdrop unconstructed error variants and the unused model override.
Validation
make check-fmt lint test markdownlint— all pass; thelinttarget nowruns
cargo doc, Clippy, and the Whitaker suite with warnings denied,and 14 unit tests pass.
make nixie— all Mermaid diagrams validate.mbake validate Makefile— valid syntax.RUSTFLAGS="-D warnings" whitaker --all -- --all-targets --all-features— exits 0 with no findings.