Skip to content

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

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

Adopt the Whitaker Dylint suite in the lint gate and CI#30
leynos merged 5 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 continuous integration, as part of the estate-wide rollout following leynos/netsuke#410. The suite now runs alongside Clippy in make lint, and CI installs whitaker-installer (cached, with a cargo binstall-or-build fallback) before the lint step.

All findings the suite reported were fixed rather than suppressed; no dylint.toml exclusions were required:

  • The Tokio runtime is now built explicitly in main so construction errors propagate instead of panicking inside the #[tokio::main] expansion (no_expect_outside_tests).
  • The store root is created through cap_std::fs::Dir::create_ambient_dir_all, making the server's single ambient filesystem operation explicit, and storage test fixtures write through a capability-scoped Dir handle (no_std_fs_operations).
  • The user test helpers return anyhow::Result and tests consume them with ?, using anyhow::ensure! because the crate denies clippy::panic_in_result_fn (no_unwrap_or_else_panic).
  • Every unit test module now begins with a //! inner doc comment (module_must_have_inner_docs).

Review walkthrough

  • Makefile — adds the WHITAKER tool variable and appends the suite to the lint target after Clippy.
  • .github/workflows/ci.yml — adds the installer version pin, cache step, and install step before the lint step.
  • src/main.rs — explicit runtime construction with error propagation.
  • src/config.rs — cap-std-based store root creation.
  • src/storage.rs — capability-scoped test fixture writes and test module documentation.
  • src/user.rs — fallible test helpers consumed with ? and ensure!.
  • Cargo.toml — adds the cap-std dependency.

Validation

  • make check-fmt — passed.
  • make lint — passed (Clippy with -D warnings plus whitaker --all -- --all-targets --all-features with RUSTFLAGS="-D warnings").
  • make typecheck — passed.
  • make test — passed (50 tests, 0 failures).
  • make markdownlint — passed.
  • make nixie — passed.
  • mbake validate Makefile — valid syntax.

leynos added 2 commits July 8, 2026 13:12
Prepare the codebase for the Whitaker Dylint suite by resolving every
finding it reports:

- Build the Tokio runtime explicitly in `main` so runtime construction
  errors propagate as `Result` instead of panicking inside the
  `#[tokio::main]` expansion (`no_expect_outside_tests`).
- Create the store root with `cap_std::fs::Dir::create_ambient_dir_all`
  so the single ambient filesystem operation is explicit, and write
  test fixtures through a capability-scoped `Dir` handle rooted at the
  temporary directory (`no_std_fs_operations`).
- Return `anyhow::Result` from the `user` test helpers and consume
  them with `?`, replacing panicking `unwrap_or_else` closures; use
  `anyhow::ensure!` in the now-fallible tests because the crate denies
  `clippy::panic_in_result_fn` (`no_unwrap_or_else_panic`).
- Add `//!` inner doc comments to every unit test module
  (`module_must_have_inner_docs`).

Adds a `cap-std` dependency for the capability-based filesystem
handles.
Run the Whitaker Dylint suite (v0.2.5) alongside Clippy so the
capability-based filesystem, panic-hygiene, and module-documentation
lints gate every change:

- Makefile: add a `WHITAKER` tool variable and run
  `whitaker --all -- --all-targets --all-features` with warnings
  denied after Clippy in the `lint` target.
- CI: cache and install `whitaker-installer` (via `cargo binstall`
  when available, falling back to `cargo install --locked`) before
  the lint step, pinned to v0.2.5.

Part of the estate-wide Whitaker rollout; mirrors the adoption in
leynos/netsuke#410.

@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: d898c544-81ab-4f1e-9066-ba9513210a73

📥 Commits

Reviewing files that changed from the base of the PR and between 74b9bdd and c5fef40.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • .github/workflows/ci.yml
  • Cargo.toml
  • Makefile
  • README.md
  • src/config.rs
  • src/framing.rs
  • src/identity.rs
  • src/main.rs
  • src/query.rs
  • src/rate_limit.rs
  • src/server.rs
  • src/storage.rs
  • src/user.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.

codescene-access[bot]

This comment was marked as outdated.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: afaba07b7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Makefile
leynos added 3 commits July 8, 2026 13:27
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.
Collapse the five near-identical rejection tests in src/user.rs
(rejects_mismatched_username, rejects_invalid_username_value,
rejects_missing_username_field, rejects_non_string_value and
rejects_invalid_toml) into a single rstest-parameterized case that takes the
profile body and an error-variant predicate per case. This addresses the
CodeScene "Code Duplication" finding while preserving one named case per
rejected input.
The README's fast-feedback checklist still described linting as Clippy only,
while `make lint` now also runs the Whitaker Dylint suite. Document the
`make lint` behaviour and the whitaker-installer provisioning step so that
contributors do not pass locally and then hit CI-only failures.
@leynos
leynos merged commit e44f041 into main Jul 9, 2026
6 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