diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 552feed..919c5f9 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,24 @@ 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 + if cargo binstall --version >/dev/null 2>&1; then + 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 "${WHITAKER_INSTALLER_VERSION}" + fi + fi + whitaker-installer - name: Lint run: make lint - name: Test and Measure Coverage 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/Makefile b/Makefile index 6f021be..6843fca 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 -- $(CARGO_FLAGS) fmt: ## Format Rust and Markdown sources $(CARGO) fmt --all 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 +}