Unify lint CI job#7505
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Dependabot pre-commit updates, introduces a repository-level Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant CI as CI Jobs
participant PC as Pre-commit Hooks
participant RD as Reviewdog
Dev->>GH: Push PR / commit
GH->>CI: Trigger workflows (ci.yaml)
CI->>PC: Run pre-commit pipeline (`.pre-commit-config.yaml`)
PC-->>CI: Return hook results (pass/fail)
CI->>CI: Run cargo/doc/clippy/shear/actionlint/zizmor/prek steps
CI-->>GH: Report job status
GH->>RD: On lint/format failure, run reviewdog suggester
RD-->>Dev: Post inline suggestions/comments
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
.pre-commit-config.yaml (2)
24-31: Consider addingpass_filenames: falsefor consistency.The script
scripts/check_redundant_patches.pyignores CLI arguments and always scans the entireLib/testdirectory (see lines 10-12 of the script). The currenttypes_or: [python]setting passes filenames that are never used.For clarity, consider:
♻️ Suggested improvement
- id: redundant-test-patches name: Ensure no redundant test patches entry: python scripts/check_redundant_patches.py language: system - types_or: [python] + files: '^Lib/test/.*\.py$' + pass_filenames: false priority: 0This makes the trigger more explicit (only run when test files change) and documents that filenames aren't used.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.pre-commit-config.yaml around lines 24 - 31, The hook redundant-test-patches uses scripts/check_redundant_patches.py which ignores passed filenames, so update the hook definition for id "redundant-test-patches" to explicitly set pass_filenames: false and keep the existing entry ("python scripts/check_redundant_patches.py") so pre-commit won't pass unused file args to that script; this makes the hook intent explicit and avoids misleading invocation semantics.
43-49: Add file filter to only trigger on relevant changes.This hook runs on every commit since there's no
filesortypesfilter. The script only needs to run whencrates/compiler-core/src/bytecode/instruction.rschanges.♻️ Suggested improvement
- id: generate-opcode-metadata name: Generate opcode metadata entry: python scripts/generate_opcode_metadata.py pass_filenames: false language: system + files: 'crates/compiler-core/src/bytecode/instruction\.rs$' require_serial: true # so rustfmt runs first priority: 1This avoids unnecessary script execution and potential git status changes when the bytecode file hasn't been modified.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.pre-commit-config.yaml around lines 43 - 49, The pre-commit hook with id "generate-opcode-metadata" currently runs on every commit; update its configuration in .pre-commit-config.yaml to add a files filter that matches the bytecode source file (crates/compiler-core/src/bytecode/instruction.rs) so the hook only triggers when that file changes; locate the hook by the id/name ("generate-opcode-metadata" / "Generate opcode metadata") and add an appropriate files entry (or types entry) to restrict execution to that path..github/workflows/ci.yaml (1)
355-358: Consider pinning cargo-shear version for reproducibility.The
cargo binstall --no-confirm cargo-shearcommand installs the latest version, which could cause unexpected CI failures if a new version introduces breaking changes or new lints.♻️ Suggested improvement
- name: cargo shear run: | - cargo binstall --no-confirm cargo-shear + cargo binstall --no-confirm cargo-shear@1.1.3 cargo shearAlternatively, Dependabot could manage this if cargo-shear is added as a dev-dependency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yaml around lines 355 - 358, Pin the cargo-shear installation in the "cargo shear" workflow step instead of installing the latest: replace the current installer invocation (cargo binstall --no-confirm cargo-shear) with a pinned installer command that specifies a known-good version (e.g., cargo-shear@<version>), or add cargo-shear as a dev-dependency and let Dependabot manage updates; update the workflow step that runs "cargo shear" to rely on that pinned installation so CI remains reproducible.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 355-358: Pin the cargo-shear installation in the "cargo shear"
workflow step instead of installing the latest: replace the current installer
invocation (cargo binstall --no-confirm cargo-shear) with a pinned installer
command that specifies a known-good version (e.g., cargo-shear@<version>), or
add cargo-shear as a dev-dependency and let Dependabot manage updates; update
the workflow step that runs "cargo shear" to rely on that pinned installation so
CI remains reproducible.
In @.pre-commit-config.yaml:
- Around line 24-31: The hook redundant-test-patches uses
scripts/check_redundant_patches.py which ignores passed filenames, so update the
hook definition for id "redundant-test-patches" to explicitly set
pass_filenames: false and keep the existing entry ("python
scripts/check_redundant_patches.py") so pre-commit won't pass unused file args
to that script; this makes the hook intent explicit and avoids misleading
invocation semantics.
- Around line 43-49: The pre-commit hook with id "generate-opcode-metadata"
currently runs on every commit; update its configuration in
.pre-commit-config.yaml to add a files filter that matches the bytecode source
file (crates/compiler-core/src/bytecode/instruction.rs) so the hook only
triggers when that file changes; locate the hook by the id/name
("generate-opcode-metadata" / "Generate opcode metadata") and add an appropriate
files entry (or types entry) to restrict execution to that path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 98cc673b-3373-4fa2-aea3-bdbbc11edfd3
📒 Files selected for processing (4)
.github/dependabot.yml.github/workflows/ci.yaml.github/workflows/pr-format.yaml.pre-commit-config.yaml
💤 Files with no reviewable changes (1)
- .github/workflows/pr-format.yaml
Sorry, something went wrong.
a8a9358 to
89d4a0b
Compare
March 25, 2026 18:20
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/operator.py dependencies:
dependent tests: (43 tests)
Legend:
|
Sorry, something went wrong.
41c8e3a to
1796ab9
Compare
March 25, 2026 18:25
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/check_redundant_patches.py`:
- Line 16: The function build_argparser has an incorrect return type annotation
that calls the constructor; change the annotation from argparse.ArgumentParser()
to the class type argparse.ArgumentParser (no parentheses) and keep the function
body returning a new instance as before; update the signature for
build_argparser accordingly so the type hint refers to the class, not an
instantiated object.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 54e4bb07-26cf-48f8-994e-80f69b4f2b7d
⛔ Files ignored due to path filters (1)
Lib/test/test_operator.pyis excluded by!Lib/**
📒 Files selected for processing (5)
.github/dependabot.yml.github/workflows/ci.yaml.github/workflows/pr-format.yaml.pre-commit-config.yamlscripts/check_redundant_patches.py
💤 Files with no reviewable changes (1)
- .github/workflows/pr-format.yaml
✅ Files skipped from review due to trivial changes (2)
- .github/dependabot.yml
- .pre-commit-config.yaml
Sorry, something went wrong.
a0a0172 to
14e04ed
Compare
March 25, 2026 18:40
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yaml:
- Around line 355-358: The workflow currently installs the latest cargo-shear
which can break CI; update the step that runs "cargo binstall --no-confirm
cargo-shear" to pin cargo-shear to an exact version using the cargo-binstall
syntax (e.g., "cargo-shear@=x.y.z"); modify the step named "cargo shear" so the
binstall command references the pinned package name and leave the subsequent
"cargo shear" invocation unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: c3be1671-bb45-4158-82ed-2ae52e09aaa3
⛔ Files ignored due to path filters (1)
Lib/test/test_operator.pyis excluded by!Lib/**
📒 Files selected for processing (3)
.github/workflows/ci.yaml.pre-commit-config.yamlscripts/check_redundant_patches.py
✅ Files skipped from review due to trivial changes (2)
- .pre-commit-config.yaml
- scripts/check_redundant_patches.py
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)
355-358: ⚠️ Potential issue | 🟠 MajorLine 357 still leaves
cargo-shearfloating.Installing the current
cargo-shearrelease on every run makes the unified lint job vulnerable to unrelated upstream breakage.cargo-binstallsupports selecting an explicit package version, so this should be pinned too. (github.com)♻️ Suggested fix
- name: cargo shear run: | - cargo binstall --no-confirm cargo-shear + cargo binstall --no-confirm cargo-shear@<tested-version> cargo shear🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yaml around lines 355 - 358, The CI step named "cargo shear" currently installs the latest cargo-shear with "cargo binstall --no-confirm cargo-shear" which risks upstream breakage; change the install to pin a specific release by using the cargo-binstall version syntax (e.g., replace that line with "cargo binstall --no-confirm cargo-shear@<VERSION>") and keep invoking the tool via "cargo shear" so the job installs a fixed cargo-shear release instead of the floating latest.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yaml:
- Around line 332-338: The unified lint job ("name: Lint") is missing the
skip:ci short-circuit used elsewhere; update the Lint job to include the same
conditional guard used by other jobs so the workflow is skipped when the skip:ci
label is present on a PR (i.e., add the same "if" expression/guard that checks
for the skip:ci label to the Lint job), leaving the existing permissions block
intact.
- Around line 334-338: Add the missing permission and guard the reviewdog action
to PRs only: under the workflow permissions block add "issues: write" alongside
the existing "checks: write" and "pull-requests: write", and update the
reviewdog/action-suggester step's if condition so it only runs in a pull request
context (e.g. change the current if: failure() to an expression that also checks
the event is a pull_request, like github.event_name == 'pull_request' &&
failure()).
- Line 353: The workflow step that uses the action
"cargo-bins/cargo-binstall@113a77a4ce971c41332f2129c3d995df993cf746" should
explicitly pin the cargo-binstall binary by adding an inputs block (with:) and
setting the version field to a specific release (e.g., version: "v1.17.8" or the
exact binary tag you want), so update the step that contains the uses:
cargo-bins/cargo-binstall... line to include a with: version: "<pinned-version>"
entry to ensure reproducible installs.
---
Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 355-358: The CI step named "cargo shear" currently installs the
latest cargo-shear with "cargo binstall --no-confirm cargo-shear" which risks
upstream breakage; change the install to pin a specific release by using the
cargo-binstall version syntax (e.g., replace that line with "cargo binstall
--no-confirm cargo-shear@<VERSION>") and keep invoking the tool via "cargo
shear" so the job installs a fixed cargo-shear release instead of the floating
latest.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 51feb7dc-e3f3-4f03-9aa0-ad86e0d5ea14
⛔ Files ignored due to path filters (1)
Lib/test/test_operator.pyis excluded by!Lib/**
📒 Files selected for processing (3)
.github/workflows/ci.yaml.pre-commit-config.yamlscripts/check_redundant_patches.py
✅ Files skipped from review due to trivial changes (1)
- .pre-commit-config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
- scripts/check_redundant_patches.py
Sorry, something went wrong.
562a999 to
15b06c2
Compare
March 25, 2026 19:00
9282a87
into
RustPython:main
Mar 26, 2026
|
👍 |
Sorry, something went wrong.
ATM we have multiple places where we define lint steps, like running
ruffthis PR aims to streamline the process by condensing everything to a single jobSummary by CodeRabbit
Chores
Tooling