◐ Shell
clean mode source ↗

Auto-format before checks by ShaharNaveh · Pull Request #6275 · RustPython/RustPython

Walkthrough

Consolidates PR auto-formatting into an auto_format_pr job in .github/workflows/ci.yaml, removes the standalone .github/workflows/pr-auto-commit.yaml, and updates multiple CI jobs to depend on the new formatting gate while changing skip checks to be cancellation-aware plus skip:ci.

Changes

Cohort / File(s) Summary
CI pipeline — integrated auto-format job
​.github/workflows/ci.yaml
Adds auto_format_pr job that checks out the PR branch, installs rustfmt, runs cargo fmt, commits/pushes formatting changes when detected, comments on the PR, and exits after pushing. Updates several jobs to needs: auto_format_pr and replaces simple skip checks with !cancelled() && !contains(labels, 'skip:ci').
Removed standalone workflow
​.github/workflows/pr-auto-commit.yaml
Deleted the prior PR auto-commit workflow that previously ran cargo fmt, committed/pushed changes, and commented on the PR.
Minor formatting change
crates/vm/src/stdlib/ast/other.rs
Non-functional styling/formatting adjustments (line wraps/indentation) with no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant Auto as auto_format_pr (ci.yaml)
    participant CI as Dependent CI Jobs

    PR->>Auto: PR event triggers job
    activate Auto
    Auto->>Auto: checkout PR branch\ninstall rustfmt\nrun cargo fmt
    Note over Auto: Detect formatting diffs
    alt Formatting changes detected
        Auto->>PR: git commit & push formatted changes
        Auto->>PR: post PR comment instructing to pull latest changes
        Auto-x Auto: exit (fails to signal author to sync)
    else No formatting changes
        Auto-->>Auto: complete successfully
    end
    deactivate Auto

    Note right of CI: Jobs now have needs: auto_format_pr\nand condition: !cancelled() && !contains(labels,'skip:ci')
    Auto->>CI: unblocks dependent jobs or triggers re-run if branch changed
    activate CI
    CI->>CI: run tests/lint/etc.
    deactivate CI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify auto_format_pr job steps: checkout, rustfmt install, cargo fmt, git config, commit/push, and PR-comment content.
  • Confirm each updated job (rust_tests, exotic_targets, snippets_cpython, lint, miri, wasm, wasm-wasi) includes needs: auto_format_pr and the new conditional !cancelled() && !contains(labels, 'skip:ci').
  • Check removal of .github/workflows/pr-auto-commit.yaml and ensure no remaining references.
  • Review crates/vm/src/stdlib/ast/other.rs for unintentional semantic changes (quick scan; formatting-only).

Possibly related PRs

Suggested labels

skip:ci

Poem

🐇 I hopped through files with a whiskered grin,
Ran rustfmt softly to tidy within.
I pushed neat lines and left a small note,
Now CI waits kindly for authors to quote.
🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Auto-format before checks' accurately captures the main change: moving auto-formatting to run before other CI checks to resolve the timeout issues.
Linked Issues check ✅ Passed The PR successfully implements approach #2 from issue #6272: ensuring auto-format runs before CI jobs by adding it as a gating job that subsequent tests depend on.
Out of Scope Changes check ✅ Passed Changes in ast/other.rs are minor formatting-only and directly result from the new cargo fmt job running in this PR; all changes align with resolving the CI auto-format timeout issue.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65549b2 and a577106.

📒 Files selected for processing (1)
  • crates/vm/src/stdlib/ast/other.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • crates/vm/src/stdlib/ast/other.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Run snippets and cpython tests (windows-latest)
  • GitHub Check: Run snippets and cpython tests (ubuntu-latest)
  • GitHub Check: Check the WASM package and demo
  • GitHub Check: Run snippets and cpython tests (macos-latest)
  • GitHub Check: Run tests under miri
  • GitHub Check: Run snippets and cpython tests on wasm-wasi
  • GitHub Check: Run rust tests (windows-latest)
  • GitHub Check: Run rust tests (macos-latest)
  • GitHub Check: Run rust tests (ubuntu-latest)
  • GitHub Check: Ensure compilation on various targets
  • GitHub Check: auto_format

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.