Skip to content

Fix pr-format CI to fail on formatting changes#7411

Merged
youknowone merged 2 commits intoRustPython:mainfrom
youknowone:ci-format
Mar 12, 2026
Merged

Fix pr-format CI to fail on formatting changes#7411
youknowone merged 2 commits intoRustPython:mainfrom
youknowone:ci-format

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Mar 12, 2026

fmt CI is lost. we have to recover it

Summary by CodeRabbit

  • Chores
    • Improved code formatting consistency across the codebase.
    • Enhanced CI/CD checks to validate formatting standards in pull requests.
    • Consolidated module organization and removed redundant declarations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: b77fa113-fbbb-42e6-9f34-61d3307fe276

📥 Commits

Reviewing files that changed from the base of the PR and between 61b3b4f and a14f856.

📒 Files selected for processing (3)
  • .github/workflows/pr-format.yaml
  • crates/stdlib/src/_tokenize.rs
  • crates/stdlib/src/lib.rs

📝 Walkthrough

Walkthrough

The PR enhances the formatting validation workflow by adding a check for uncommitted formatting changes that fails the job if detected, while reorganizing the stdlib tokenizer module declaration and applying formatting improvements to the tokenizer source file.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/pr-format.yaml
Adds a new "Check for formatting changes" step that detects uncommitted formatting diffs and fails the job with guidance. Updates "Post formatting suggestions" step to run conditionally on prior step failure.
Code Organization
crates/stdlib/src/lib.rs
Deduplicates tokenizer module declaration by moving it earlier in the file and removing the later duplicate occurrence.
Formatting & Style
crates/stdlib/src/_tokenize.rs
Applies formatting improvements including reorganized imports, converted multi-line statements to single-line equivalents, and tightened line breaks; no functional changes to logic or control flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Hopping through the code with care,
Formatting checked at every layer,
Imports aligned and modules de-dup'd,
The CI pipeline's now all set up!
✨ Clean code hops on, ready to share!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Add git diff --exit-code step to fail the check when
formatters produce changes. Previously reviewdog only
posted suggestions without failing the workflow.
@youknowone youknowone marked this pull request as ready for review March 12, 2026 23:52
@youknowone youknowone merged commit 7c05bef into RustPython:main Mar 12, 2026
14 of 15 checks passed
@youknowone youknowone deleted the ci-format branch March 12, 2026 23:53
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.

1 participant