Skip to content

ci: add cargo fmt check to CI#158

Merged
ElFantasma merged 3 commits intomainfrom
ci/cargo-fmt
Mar 13, 2026
Merged

ci: add cargo fmt check to CI#158
ElFantasma merged 3 commits intomainfrom
ci/cargo-fmt

Conversation

@ElFantasma
Copy link
Copy Markdown
Collaborator

Summary

  • Add cargo fmt --all -- --check job to CI workflow
  • Fix all existing formatting issues across 33 files

Test plan

  • CI passes (build, test, clippy, fmt)

@github-actions
Copy link
Copy Markdown

🤖 Kimi Code Review

Review Summary

This PR primarily consists of formatting changes (cargo fmt) and CI improvements. The changes appear to be purely stylistic with no functional modifications.

Issues Found

None. The changes are all formatting-related and don't introduce any bugs or performance issues.

Positive Changes

  1. CI Enhancement: Added a dedicated fmt job to ensure consistent code formatting (.github/workflows/ci.yml:31-39)
  2. Code Consistency: Applied cargo fmt across the entire codebase, improving readability and maintaining consistent style
  3. No Breaking Changes: All modifications are non-functional formatting changes

Minor Observations

  • The formatting changes are extensive but follow standard Rust conventions
  • Some long function signatures were split across multiple lines for better readability (e.g., concurrency/src/registry.rs:24-27)
  • Import statements were reorganized for consistency (e.g., examples/bank/src/server.rs:3-4)

The PR is ready to merge as-is.


Automated review by Kimi (Moonshot AI) · custom prompt

@github-actions
Copy link
Copy Markdown

🤖 Codex Code Review

No blocking findings.

I reviewed the diff with focus on actor lifecycle, message flow, cancellation/shutdown, concurrency safety, and performance. The Rust code changes are formatting/import-order only (no behavioral deltas in actor runtime, timers, stream handling, or macros), and the only functional change is adding a cargo fmt --check CI job.

Residual risk: I did not execute the test suite in this review pass.


Automated review by OpenAI Codex · custom prompt

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 13, 2026

Greptile Summary

This PR adds a cargo fmt --all -- --check job to the CI pipeline and fixes all pre-existing formatting violations across 33 source files to make the new check pass. The changes are purely cosmetic — no logic, behavior, or API surface is modified.

  • Added a new fmt job in .github/workflows/ci.yml that runs independently (no needs gate), checking formatting across the entire workspace with cargo fmt --all -- --check.
  • All 33 Rust source files received formatting-only changes: line-length wrapping of long function signatures, import reordering to alphabetical order, expansion of compact impl blocks, and collapsing of unnecessary block braces in match arms — all consistent with standard rustfmt rules.
  • No functional code changes are present; the PR strictly enforces the existing rustfmt style going forward.

Confidence Score: 5/5

  • This PR is safe to merge — it contains only formatting changes and a new CI enforcement job with no risk of behavioral regression.
  • All Rust file changes are mechanical cargo fmt output with zero semantic impact. The new CI job is correctly structured, uses standard GitHub Actions patterns consistent with the rest of the workflow, and rustfmt is available by default in the stable toolchain on GitHub-hosted runners. No logic, data flows, or public API surfaces were altered.
  • No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Adds a new fmt CI job that runs cargo fmt --all -- --check independently (no needs dependency), consistent with the rest of the workflow which relies on GitHub Actions' default Rust toolchain.
concurrency/src/tasks/actor.rs Pure formatting changes: line wrapping of long function signatures, struct initializations, and chained method calls. No logic changes.
macros/src/lib.rs Pure formatting changes: struct destructure patterns, chained method calls, and long conditional expressions reformatted across multiple lines. No logic changes.
concurrency/src/threads/actor.rs Pure formatting changes: MessageEnvelope struct initialization inlined and Message impls expanded to multi-line. No logic changes.
concurrency/src/response.rs Formatting only: collapsed unnecessary block braces in a match arm for ResponseState::Ready. Logic is unchanged.
rt/src/threads/oneshot.rs Formatting only: alphabetically sorted the pub use import list (Receiver moved before RecvTimeoutError). No functional change.
rt/src/threads/mod.rs Formatting only: collapsed a multi-line method chain in ctrl_c() into a single line. No functional change.
concurrency/src/threads/time.rs Formatting only: reformatted a closure body passed to rt::spawn by lifting the match out of a block. No functional change.
concurrency/src/registry.rs Formatting only: split a long function signature across multiple lines. No functional change.
examples/bank/src/server.rs Formatting only: reordered imports alphabetically and collapsed a match arm's unnecessary block braces. No functional change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    PR[Pull Request / Push to main] --> BUILD[build\nubuntu-latest\ncargo build --verbose]
    PR --> FMT[fmt\nubuntu-latest\ncargo fmt --all -- --check]
    BUILD --> TEST[test\nubuntu-latest\ncargo test --verbose]
    BUILD --> CLIPPY[clippy\nubuntu-latest\ncargo clippy --all-targets]
    BUILD --> PUBLISH[publish-dry-run\nubuntu-latest\ncargo package]

    style FMT fill:#c8f7c5,stroke:#27ae60,color:#000
Loading

Last reviewed commit: 3b32daa

@ElFantasma
Copy link
Copy Markdown
Collaborator Author

/claude

@github-actions
Copy link
Copy Markdown

🤖 Claude Code Review

PR #158 Review — ci: add cargo fmt check to CI

Summary

This is a pure formatting PR: it adds a cargo fmt --all -- --check CI job and applies the resulting rustfmt fixes across 33 files. There are no logic, correctness, or behavioral changes.


CI Workflow (.github/workflows/ci.yml)

The new fmt job looks correct:

fmt:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - name: Run cargo fmt
      run: cargo fmt --all -- --check

Minor observations:

  • No needs: dependency — fmt runs in parallel with build/clippy, which is appropriate and efficient. No issue here.
  • No explicit rustup component add rustfmt step — this is fine since rustfmt ships with the stable toolchain by default on ubuntu-latest runners.
  • If the project ever adopts a pinned toolchain (e.g., via rust-toolchain.toml), ensure rustfmt is listed as a component there. Currently there's no such file visible in the diff, so no action needed.

Formatting Changes

All diffs are purely mechanical rustfmt output:

  • Long function signatures broken to multi-line (e.g., register<T>, handle_list_all, qualify_type_with_super match arm)
  • Struct literal fields expanded to multi-line where they exceed line width
  • Import groups reordered alphabetically within use statements
  • Method chains reformatted with proper indentation
  • Trailing newline added to ai-review.md
  • Accidentally committed scratch binaries removed (second commit)

No logic, concurrency, or correctness concerns — these are all rustfmt-generated changes.


Verdict

Looks good. Clean, straightforward enforcement of consistent formatting via CI. The new job is minimal and correct. Approving this will prevent future formatting drift.


Automated review by Claude (Anthropic) · custom prompt

@ElFantasma ElFantasma merged commit 845810d into main Mar 13, 2026
5 checks passed
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.

3 participants