Skip to content

build/CI: ruff format drift not gated for pysimlin #664

Closed

Description

@bpowers

Problem

The pysimlin pre-commit / CI gate runs ruff check only, not ruff format --check. As a result Python format drift accumulates undetected. Running ruff format --check currently flags at least:

  • src/pysimlin/simlin/_ffi_build.py
  • src/pysimlin/simlin/sim.py

ruff check (the linter) does not enforce formatting, so a file that is lint-clean but not ruff format-clean passes the gate.

Why it matters

Build hygiene / developer experience: format-dirty Python files merge silently, then unrelated PRs pick up noisy reformatting diffs (or reviewers flag formatting the tooling should have caught). The repo already intends ruff format to be the Python formatter; nothing verifies it on commit or in CI.

This is the Python analogue of #627 (no prettier --check gate for TypeScript). #627 is explicitly TypeScript-only and does not cover Python/ruff.

Suggested resolution

Two parts, ordering matters (clean up first, then gate, or the gate's first run is noisy):

  1. One-time ruff format sweep to clear existing drift (the two files above), as its own commit so the formatting churn is isolated.
  2. Add ruff format --check to the pysimlin pre-commit step and CI, mirroring how Rust cargo fmt -- --check is already enforced.

Components affected

  • scripts/pre-commit (Python bindings step)
  • .github/workflows/ (CI)
  • src/pysimlin/

Severity

Low (build hygiene).

Discovery context

Identified during an LTM-hardening session while running the pysimlin gate manually.

Activity

  1. added
    hygiene
    on Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions