From b397bcc65269f95ffef9bc384a181a9b0af3e94a Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:34:08 +0200 Subject: [PATCH 1/5] Fix pre-existing formatting and lint gate failures Repair three failures that predate the Whitaker adoption so the full gate suite can pass: - Add the trailing newline `cargo fmt --check` demanded in `src/main.rs`. - Replace the `#[allow(clippy::print_stdout, ...)]` attribute on `main` with `#[expect(...)]`, as required by the crate-level `clippy::allow_attributes = "deny"` policy. - Remove a double blank line in `AGENTS.md` flagged by markdownlint (MD012). --- AGENTS.md | 1 - src/main.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 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/main.rs b/src/main.rs index c61245e..1551e46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ // TODO: Remove this stub and implement actual application functionality. /// Application entry point. -#[allow(clippy::print_stdout, reason = "CLI output is the intended behaviour")] +#[expect(clippy::print_stdout, reason = "CLI output is the intended behaviour")] fn main() { println!("Hello from dbar!"); -} \ No newline at end of file +} From 4eaf5154e01230b1f53d9e25bc9d10ff77c1b927 Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:34:18 +0200 Subject: [PATCH 2/5] Adopt the Whitaker Dylint suite in the lint gate and CI Wire the Whitaker Dylint suite (v0.2.5) into the repository's lint gate as part of the estate-wide rollout (see leynos/netsuke#410): - Makefile: add a `WHITAKER ?= whitaker` tool variable and run the suite after Clippy in the `lint` target, denying warnings via the existing `RUST_FLAGS` convention. - CI: pin `WHITAKER_INSTALLER_VERSION` as job env, cache the installer binary and the cargo-binstall cache keyed on OS, architecture, and version, and install the suite via `cargo binstall` (provided by the shared setup-rust action) before the lint step. The suite reports no findings on this crate, so no code changes were required beyond the pre-existing gate fixes in the previous commit. --- .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 6f021be..2f2d764 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) --bin $(TARGET) -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 -- --all-targets --all-features fmt: ## Format Rust and Markdown sources $(CARGO) fmt --all From 395fec271c0f887ea153a0449a8525b1a2d6b080 Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 12:41:15 +0200 Subject: [PATCH 3/5] 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 5db6b5cd95cc46a73ecd9445195a49f374c95a53 Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 13:23:22 +0200 Subject: [PATCH 4/5] 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 From 840665e6e3ac20f83da829fb06b23d23cac3c32e Mon Sep 17 00:00:00 2001 From: leynos Date: Wed, 8 Jul 2026 13:23:22 +0200 Subject: [PATCH 5/5] Honour CARGO_FLAGS in the Whitaker lint step The Clippy and test targets already honour a CARGO_FLAGS override via CLIPPY_FLAGS and TEST_FLAGS, but the Whitaker invocation hardcoded --all-targets --all-features. Pass $(CARGO_FLAGS) after the Dylint separator instead so callers overriding CARGO_FLAGS get consistent behaviour across all lint paths. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2f2d764..6843fca 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ target/%/$(TARGET): ## Build binary in debug or release mode 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 -- --all-targets --all-features + RUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS) fmt: ## Format Rust and Markdown sources $(CARGO) fmt --all