From 9e05a85d46f79ce9e7841054d957671769b3ac0a Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:34:35 +0200 Subject: [PATCH 1/4] Fix pre-existing formatting and Markdown lint failures `cargo fmt --check` failed on `src/lib.rs` because the file lacked a trailing newline, and `markdownlint` flagged two consecutive blank lines after the "Testing" heading in `AGENTS.md`. Both failures predate this branch and blocked the commit gates, so fix them here ahead of the Whitaker adoption change. --- AGENTS.md | 1 - src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d156dd0..481ff3f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -202,7 +202,6 @@ project: ### Testing - - Use `rstest` fixtures for shared setup. - Replace duplicated tests with `#[rstest(...)]` parameterized cases. - Prefer `mockall` for ad hoc mocks/stubs. diff --git a/src/lib.rs b/src/lib.rs index 483a4be..0de23b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,4 +5,4 @@ #[must_use] pub const fn greet() -> &'static str { "Hello from IMAP WASM Plugin for IronClaw!" -} \ No newline at end of file +} From effe585e7b8644525bfa33f93902e958fc25d90f Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:34:47 +0200 Subject: [PATCH 2/4] Adopt the Whitaker Dylint suite in the lint gate and CI Extend `make lint` to run the Whitaker Dylint suite after Clippy, denying warnings via the existing `RUST_FLAGS` convention and reusing `CARGO_FLAGS` for the target selection. A `WHITAKER ?= whitaker` variable sits alongside the other tool variables so the binary can be overridden. In CI, install the suite before the lint step: pin `WHITAKER_INSTALLER_VERSION` to 0.2.5 at the job level, cache the `whitaker-installer` binary and the cargo-binstall download cache, and install via `cargo binstall` (provided by the shared `setup-rust` action) when the cache misses. The suite reported no findings for this crate; no code changes or `dylint.toml` exclusions were required. This is part of the estate-wide Whitaker rollout (see leynos/netsuke#410). --- .github/workflows/ci.yml | 16 ++++++++++++++++ Makefile | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 552feed..c54f612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: env: CARGO_TERM_COLOR: always BUILD_PROFILE: debug + WHITAKER_INSTALLER_VERSION: '0.2.5' steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - name: Setup Rust @@ -26,6 +27,21 @@ jobs: **/*.md !**/target/** !**/dist/** + - name: Cache Whitaker installer + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: | + ~/.cargo/bin/whitaker-installer + ~/.cache/cargo-binstall + key: whitaker-installer-${{ runner.os }}-${{ runner.arch }}-${{ env.WHITAKER_INSTALLER_VERSION }} + - name: Install Whitaker Dylint suite + run: | + if command -v whitaker-installer >/dev/null 2>&1; then + echo "whitaker-installer already present; skipping cargo binstall" + else + cargo binstall --no-confirm whitaker-installer@${{ env.WHITAKER_INSTALLER_VERSION }} + fi + whitaker-installer - name: Lint run: make lint - name: Test and Measure Coverage diff --git a/Makefile b/Makefile index 8998183..b6f7e93 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ CLIPPY_FLAGS ?= $(CARGO_FLAGS) -- $(RUST_FLAGS) TEST_FLAGS ?= $(CARGO_FLAGS) MDLINT ?= markdownlint-cli2 NIXIE ?= nixie +WHITAKER ?= whitaker build: target/debug/$(TARGET) ## Build debug binary release: target/release/$(TARGET) ## Build release binary @@ -26,9 +27,10 @@ test: ## Run tests with warnings treated as errors target/%/$(TARGET): ## Build binary in debug or release mode $(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) -lint: ## Run Clippy with warnings denied +lint: ## Run Clippy and the Whitaker Dylint suite with warnings denied RUSTDOCFLAGS="$(RUSTDOC_FLAGS)" $(CARGO) doc --no-deps $(CARGO) clippy $(CLIPPY_FLAGS) + RUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS) fmt: ## Format Rust and Markdown sources $(CARGO) fmt --all From b79c48225b5249fc92239ef1c16308ef0ed5170e Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:41:17 +0200 Subject: [PATCH 3/4] Fall back to cargo install when cargo-binstall is unavailable The pinned shared `setup-rust` action in this repository predates binstall provisioning, so the Whitaker install step failed with "no such command: `binstall`". Try binstall first and build the installer from crates.io otherwise; the cached binary makes the fallback a one-off cost. --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c54f612..e55ff9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,13 @@ jobs: key: whitaker-installer-${{ runner.os }}-${{ runner.arch }}-${{ env.WHITAKER_INSTALLER_VERSION }} - name: Install Whitaker Dylint suite run: | - if command -v whitaker-installer >/dev/null 2>&1; then - echo "whitaker-installer already present; skipping cargo binstall" - else - cargo binstall --no-confirm whitaker-installer@${{ env.WHITAKER_INSTALLER_VERSION }} + if ! command -v whitaker-installer >/dev/null 2>&1; then + if cargo binstall --version >/dev/null 2>&1; then + cargo binstall --no-confirm whitaker-installer@${{ env.WHITAKER_INSTALLER_VERSION }} + else + echo "cargo-binstall unavailable; building whitaker-installer from crates.io" + cargo install --locked whitaker-installer --version ${{ env.WHITAKER_INSTALLER_VERSION }} + fi fi whitaker-installer - name: Lint From cfbc35a833bd4d104b5957c12c1a2358d05d5f5d Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 13:23:22 +0200 Subject: [PATCH 4/4] Harden the Whitaker install step Pass WHITAKER_INSTALLER_VERSION to the run block through the shell environment rather than inline `${{ env }}` template expansion, which zizmor flags as a template-injection risk; the job-level `env:` block already exports the variable. Add `--locked` to the cargo binstall invocation so that its compile-from-source fallback resolves dependencies from the published lockfile, keeping fallback builds reproducible. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55ff9a..919c5f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,10 +38,10 @@ jobs: run: | if ! command -v whitaker-installer >/dev/null 2>&1; then if cargo binstall --version >/dev/null 2>&1; then - cargo binstall --no-confirm whitaker-installer@${{ env.WHITAKER_INSTALLER_VERSION }} + cargo binstall --no-confirm --locked "whitaker-installer@${WHITAKER_INSTALLER_VERSION}" else echo "cargo-binstall unavailable; building whitaker-installer from crates.io" - cargo install --locked whitaker-installer --version ${{ env.WHITAKER_INSTALLER_VERSION }} + cargo install --locked whitaker-installer --version "${WHITAKER_INSTALLER_VERSION}" fi fi whitaker-installer