Skip to content

ci: clippy only lints the app crate, and mas-agent already fails it #772

Closed

Description

@EVWorth

What's wrong

Clippy over the whole workspace fails on main:

$ cd src-tauri && cargo clippy --workspace --all-targets -- -D warnings
error: items after a test module
   --> crates/mas-agent/src/claude.rs:367:1
    |
367 | mod tests {

In crates/mas-agent/src/claude.rs, #[cfg(test)] mod tests opens at line 366, but ClaudeSession (line 662), its impl (668) and spawn (737) come after it, at the end of the file.

Why CI didn't catch it

ci.yml's "Rust clippy" step runs cargo clippy --all-targets --all-features -- -D warnings in src-tauri. That directory's Cargo.toml is both the workspace root and the sqlpilot package, and with no default-members, a bare cargo clippy lints only that package. The six crates/mas-* crates are never linted in CI. just lint names them with -p, but it skips --all-targets, so test code goes unchecked there too.

Fix

  1. Move ClaudeSession and spawn above the tests module in crates/mas-agent/src/claude.rs.
  2. Add --workspace to the CI clippy step (cargo clippy --workspace --all-targets --all-features -- -D warnings). Make just lint match, so local and CI runs check the same thing.
  3. Fix anything else the wider run turns up in the same PR. That step will then catch the next regression of this kind.

Found while preparing the 1.3.0 release (#771). It doesn't block that release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustRust/Cargo updates

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions