Skip to content

CI: Systematically check formatting and test changed Rust code in CI - #23327

Open
paldepind wants to merge 4 commits into
mainfrom
cargo-fmt-ci
Open

paldepind wants to merge 4 commits into
mainfrom
cargo-fmt-ci

Conversation

@paldepind

@paldepind paldepind commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

This expands on #23257 to systematically run rustfmt and cargo test (in addition to Clippy) for changed Rust
code. This partially or entirely subsumes some of the existing workflows for Rust code.

Tests for the unified extractor, swift-syntax-rs and ast-generator are skipped. A comment in the Python script explains why.

I suggest a cursory review of the Python script.

Here's a PR based on this PR that shows this failing for malformatted Rust code: #23329

paldepind and others added 4 commits December 2, 2026 14:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a2140248-0a6d-4c90-82bd-db163885d135
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a2140248-0a6d-4c90-82bd-db163885d135
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a2140248-0a6d-4c90-82bd-db163885d135
@paldepind paldepind changed the title CI: Check formatting and test affected Rust packages CI: Systematically check formatting and test changed Rust code Dec 2, 2026
@paldepind paldepind changed the title CI: Systematically check formatting and test changed Rust code CI: Systematically check formatting and test changed Rust code in CI Dec 2, 2026
@paldepind
paldepind marked this pull request as ready for review December 2, 2026 14:01
@paldepind
paldepind requested review from a team as code owners December 2, 2026 14:01
Copilot AI adaptive review requested due to automatic review settings December 2, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing the unit-test step leaves the CI helper’s selection and formatting/test-command tests without any CI invocation.

1 open issue
What changed in this PR

Extends selective Rust CI checks to run formatting checks and tests alongside Clippy, consolidating overlapping workflows.

Changes:

  • Adds formatting and test commands for affected workspace packages.
  • Skips tests requiring unavailable Swift tooling or upstream repository layouts.
  • Expands helper tests and removes redundant CI jobs.
File Description
misc/​scripts/​rust-checks/​test_rust_checks.py Adds selection, formatting, and test-command coverage.
misc/​scripts/​rust-checks/​rust_checks.py Adds formatting checks and filtered test execution.
misc/​scripts/​cargo-clippy/​test_cargo_clippy.py Removes the superseded test suite.
.github/​workflows/​yeast-test.yml Removes the dedicated Yeast test workflow.
.github/​workflows/​tree-sitter-extractor-test.yml Removes dedicated formatting and test jobs.
.github/​workflows/​rust.yml Removes redundant formatting and compilation jobs.
.github/​workflows/​rust-checks.yml Runs centralized formatting, Clippy, and tests.
.github/​workflows/​ql-for-ql-tests.yml Removes the separate formatting step.
.github/​workflows/​cpp-bmn.yml Removes the redundant Cargo job.

Review effort: Balanced (adaptive)

fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Test package selection
run: python3 -m unittest discover -s misc/scripts/cargo-clippy
- name: Select affected packages

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants