Skip to content

Adopt the Whitaker Dylint suite in the lint gate and CI - #20

Merged
leynos merged 3 commits into
mainfrom
adopt-whitaker
Jul 9, 2026
Merged

Adopt the Whitaker Dylint suite in the lint gate and CI#20
leynos merged 3 commits into
mainfrom
adopt-whitaker

Conversation

@leynos

@leynos leynos commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

This pull request adopts the Whitaker Dylint suite (v0.2.5) in the lint
gate 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:

  • The Tokio runtime is now built explicitly so construction failures
    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!.
  • Documentation HTML is read through a cap_std::fs::Dir capability handle
    scoped to the documentation root, replacing ambient std::fs calls.
  • Dead code is removed (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.
  • Long functions (format_docs_summary, convert_links, extract_zip,
    extract_items) are decomposed into focused helpers, match-on-Option
    blocks become let ... else, string building uses push_str rather than
    appending format! output, and every test module gains an inner doc
    comment. parser/item.rs returns beneath the 400-line module limit.
  • README and AGENTS Markdown lint errors (line length, unlabelled fences,
    list spacing, double blanks) are fixed so make markdownlint passes.

The second commit wires the suite in: make lint runs
RUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS) after
Clippy, and CI installs whitaker-installer 0.2.5 (via cargo binstall,
falling back to cargo install when binstall is unavailable) with the
installer binary and binstall cache keyed on OS, architecture, and version.
No dylint.toml exclusions were required; the suite passes cleanly.

Review walkthrough

Validation

  • make check-fmt lint test markdownlint — all pass; the lint target now
    runs 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.

leynos added 2 commits July 8, 2026 13:03
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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 64be2c60-e850-43d8-b958-08234cd812f8

📥 Commits

Reviewing files that changed from the base of the PR and between d38cdff and c248b18.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • .github/workflows/ci.yml
  • AGENTS.md
  • Cargo.toml
  • Makefile
  • README.md
  • src/error.rs
  • src/fetcher.rs
  • src/main.rs
  • src/output.rs
  • src/parser/index.rs
  • src/parser/item.rs
  • src/parser/markdown.rs
  • src/parser/mod.rs
  • src/summarizer.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adopt-whitaker

Comment @coderabbitai help to get the list of available commands.

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.
@leynos
leynos merged commit 85e38b2 into main Jul 9, 2026
5 checks passed
@leynos
leynos deleted the adopt-whitaker branch July 9, 2026 18:16
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