Skip to content

CI: add cargo clippy lint job to build.yml #193

Description

@dobby-coder

Problem

.github/workflows/build.yml runs cargo test and cargo fmt --check per-workspace, but there is no cargo clippy job. Clippy catches whole classes of bugs (correctness, perf, suspicious patterns) that rustc and rustfmt miss, and is the standard third leg of a Rust CI matrix.

Adding it now should be cheap; running it for the first time will surface a backlog of warnings to triage.

Suggested job (place alongside format: in build.yml)

  clippy:
    name: Clippy workspace
    strategy:
      matrix:
        workspace: [core, pkg, cli, ffi]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - run: cargo clippy --manifest-path pg-${{ matrix.workspace }}/Cargo.toml --all-targets --all-features -- -D warnings

pg-core features differ — if --all-features is too aggressive there (e.g. enables test + rust + stream simultaneously), drop to the feature set the test: job uses for core (test,rust,stream).

Rollout

  1. Land the workflow first with -- -W warnings (warn-only) so it doesn't block PRs while the backlog is triaged.
  2. Fix or #[allow(...)] the warnings (separate PR).
  3. Flip to -D warnings once green.

Verification

  • The job appears in the next PR's checks list.
  • Clippy completes for all four manifests on ubuntu-latest.

Filed by the audit routine. Comment to triage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions