From d9387aae58fbc778b5cacc43ba3d07256f0f9d07 Mon Sep 17 00:00:00 2001 From: "jin.2" Date: Sat, 7 Mar 2026 15:41:56 +0900 Subject: [PATCH] ci: add clippy check to Rust CI workflow (#675) Add `cargo clippy -- -D warnings` step to the Rust CI job so that clippy warnings fail the build. Also fix the one new lint (`unnecessary_map_or`) introduced in the current stable clippy. Fixes #672 Co-authored-by: hyunjinee Co-authored-by: Claude Opus 4.6 --- .github/workflows/ci.yml | 5 ++++- cli/src/native/cdp/chrome.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 788edd6..c6c5215 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: - components: rustfmt + components: rustfmt, clippy - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -75,6 +75,9 @@ jobs: - name: Format check run: cargo fmt --manifest-path cli/Cargo.toml -- --check + - name: Clippy check + run: cargo clippy --manifest-path cli/Cargo.toml -- -D warnings + - name: Run Rust tests run: cargo test --profile ci --manifest-path cli/Cargo.toml diff --git a/cli/src/native/cdp/chrome.rs b/cli/src/native/cdp/chrome.rs index 2e80eee..8edbbb2 100644 --- a/cli/src/native/cdp/chrome.rs +++ b/cli/src/native/cdp/chrome.rs @@ -123,7 +123,7 @@ fn build_chrome_args(options: &LaunchOptions) -> Result { let has_extensions = options .extensions .as_ref() - .map_or(false, |exts| !exts.is_empty()); + .is_some_and(|exts| !exts.is_empty()); // Extensions require headed mode in native Chrome (content scripts are not // injected in headless mode). Skip --headless when extensions are loaded.