Skip to content

chore: apply cargo fmt to pyopenquant so lint-test goes green - #20

Merged
Sean-Koval merged 1 commit into
mainfrom
chore/cargo-fmt-pyopenquant
Aug 31, 2026
Merged

chore: apply cargo fmt to pyopenquant so lint-test goes green#20
Sean-Koval merged 1 commit into
mainfrom
chore/cargo-fmt-pyopenquant

Conversation

@Sean-Koval

Copy link
Copy Markdown
Contributor

Why

ci.yml's lint-test job has been red on main for months — since at least 8087122 — because
crates/pyopenquant/src/ is not rustfmt-clean. cargo fmt -- --check exited 1 with 1038 lines of diff.

A permanently-red CI job is worse than no CI job: it trains everyone to ignore the signal. That is
part of how a failing check:api-drift and 13 broken production redirects shipped unnoticed.

What changed

cargo fmt, nothing else. 19 files, +305/−149, all under crates/pyopenquant/src/. No other
crate needed formatting. No Cargo.toml, no docs-site/, no python/, no .github/.

Zero behaviour change — and it was checked, not assumed

  • 14 of 19 files verified identical under whitespace-stripped hashing (differing only in whitespace
    and trailing commas).
  • The remaining 5 (cla, labeling, portfolio, sample_weights, synthetic_bt) were read hunk
    by hunk: all reflow, closure-brace wrapping, or exploded argument lists.

Verification

  • Before: cargo fmt -- --check → exit 1 · After: → exit 0. Real exit codes, no pipes.
  • rustfmt.toml's three nightly-only options (imports_granularity, group_imports,
    reorder_impl_items) are left untouched — stable warns and ignores them, matching CI.

One pre-existing note, not introduced here

A bare cargo check --all-targets fails locally with "Python interpreter version (3.14) is newer
than PyO3's maximum supported version (3.13)"
from the pyo3 build script, before any project source
compiles. With PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 it exits 0 and checks cleanly — and CI already
sets that variable, so CI is unaffected.

The lint-test CI job runs `cargo fmt -- --check`, which has been failing
on main because crates/pyopenquant/src/*.rs was never rustfmt-clean.
Running stable `cargo fmt` reformats 19 files in that crate; the changes
are purely mechanical (line reflow, trailing commas, closure bodies
wrapped in braces) with no logic, dependency, or API changes.

rustfmt.toml's nightly-only options (imports_granularity, group_imports,
reorder_impl_items) still warn and are ignored on stable; that is
unchanged and matches what CI runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jWVczUsZvbLh41F7ejWqA
@Sean-Koval
Sean-Koval merged commit 222562f into main Aug 31, 2026
0 of 6 checks passed
@Sean-Koval
Sean-Koval deleted the chore/cargo-fmt-pyopenquant branch August 31, 2026 03:12
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