Skip to content

Compare cargo-machete for dependency checks in CI - #11477

Closed
sdf-jkl wants to merge 1 commit into
apache:mainfrom
sdf-jkl:codex/unused-dependencies-machete
Closed

sdf-jkl wants to merge 1 commit into
apache:mainfrom
sdf-jkl:codex/unused-dependencies-machete

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Oct 9, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Related to #11166.

Rationale for this change

This draft provides the Machete comparison for the proposed switch to Shear in #11476, focused on detection quality and false positives. It replaces the existing dependency-only Clippy runs with a repository-wide scan that also checks dev-dependencies and Parquet crates.

Dependencies are intentionally unchanged and no ignores are added. The new job is expected to fail and expose the doctest false positives in CI for review.

What changes are included in this PR?

  • Add a job using cargo-machete 0.9.2 with --with-metadata, covering workspace packages and the excluded PyArrow crates.
  • Remove the 54 dependency-only Clippy invocations and preserve all 18 regular Clippy checks.
  • Use the same SHA-pinned checkout and tool installer actions as the existing workflows.
  • Change only the two workflow files. Findings fail the job without applying fixes; merge requirements are unchanged.

Are these changes tested?

actionlint, git diff --check, and typos --config typos.toml pass.

On upstream base e17d04788f, the local Machete scan exits with status 1 and reports:

Crate Reported dependencies Assessment
arrow-csv bytes, futures, tokio False positives: used in reader doctests
arrow-json bytes, futures, tokio False positives: used in reader doctests

Shear 1.14.0 passes all three scans on the same base with no findings. The previously observed unused and misplaced dependencies have already been corrected upstream. These are observed results on this checkout, not an exhaustive assessment of either tool's false-negative rate.

The PR CI run will validate installation and execution in GitHub Actions.

Codex assisted with the workflow edits, local validation, and this description.

Are there any user-facing changes?

No. This changes CI only.

@Jefffrey

Copy link
Copy Markdown
Contributor

@Jefffrey Jefffrey closed this Oct 15, 2026
adriangb pushed a commit to pydantic/arrow-rs that referenced this pull request Oct 15, 2026
# Which issue does this PR close?

closes apache#11166.

# Rationale for this change

The existing unused-dependency checks add 54 Clippy invocations across
Arrow crates and exclude tests and benchmarks. Replace them with
cargo-shear to check dependencies across the repository, including
dev-dependencies and Parquet crates.

The Machete comparison draft apache#11477 evaluates detection quality and
false positives on the same upstream base. Dependencies remain unchanged
so the PR CI runs show each tool's findings directly.

# What changes are included in this PR?

- Add a job using cargo-shear 1.14.0 with `--deny-warnings`, covering
the workspace and both excluded PyArrow crates. The excluded-crate scans
still run if an earlier scan finds issues.
- Remove the 54 dependency-only Clippy invocations and preserve all 18
regular Clippy checks.
- Use the same SHA-pinned checkout and tool installer actions as the
existing workflows.
- Change only the two workflow files. Findings fail the job without
applying fixes or adding ignores; merge requirements are unchanged.

# Are these changes tested?

`actionlint`, `git diff --check`, and `typos --config typos.toml` pass.

On upstream base `e17d04788f`, all three local Shear scans pass with no
findings. Machete 0.9.2 reports six false positives on that same base:
`bytes`, `futures`, and `tokio` in each of `arrow-csv` and `arrow-json`,
all used in reader doctests.

The previously observed unused and misplaced dependencies have already
been corrected upstream. This PR contains no dependency cleanup. The PR
CI run will validate installation and execution in GitHub Actions.

Codex assisted with the workflow edits, local validation, and this
description.

# Are there any user-facing changes?

No. This changes CI only.

---------

Co-authored-by: Jeffrey Vo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants