Skip to content

build: pysimlin CI/pre-commit does not run ruff check (lint gate missing; 2 pre-existing E501 violations undetected) #551

Closed

Description

@bpowers

Problem

scripts/pysimlin-tests.sh -- the script invoked by both the pre-commit hook and CI for the Python bindings -- runs only:

  • uv run --directory src/pysimlin mypy simlin/ (line ~38)
  • uv run --directory src/pysimlin pytest -n auto -q --no-cov tests/ (line ~41)

There is no uv run ruff check step. As a result, ruff lint violations in src/pysimlin (both simlin/ and tests/) are never caught by CI or the pre-commit hook, even though ruff is the project's configured Python linter.

Concrete evidence

Two pre-existing E501 (line-too-long, 116 > 100) violations exist on pristine HEAD in src/pysimlin/tests/test_json_types.py:

  • Line 139
  • Line 161

Both are the same construct:

compat = Compat(non_negative=nn, can_be_module_input=cbmi, is_public=is_pub) if (nn or cbmi or is_pub) else None

Reproduce:

cd src/pysimlin && uv run ruff check tests/test_json_types.py
# Found 2 errors. (E501 at tests/test_json_types.py:139:101 and :161:101)

These violations were introduced in commit fcb1cbf9c (2026-02-24) and have gone undetected ever since -- precisely because there is no ruff gate in the test/lint pipeline.

Why it matters

  • Developer experience / consistency: Python lint drift accumulates silently. The project lints Rust (clippy), TypeScript (eslint), but the Python linter is not enforced, so the pysimlin codebase can degrade without any signal.
  • Maintainability: Style/lint regressions are caught late (or never), making cleanup commits larger and noisier.
  • Trust in the gate: Contributors reasonably assume scripts/pysimlin-tests.sh enforces the configured linter; the silent gap is surprising.

Component(s) affected

  • scripts/pysimlin-tests.sh (missing lint step)
  • src/pysimlin/tests/test_json_types.py (2 pre-existing E501 violations)
  • Pre-commit hook (scripts/pre-commit) and CI, which both delegate to the script above

Possible approaches

  1. Add a uv run --directory src/pysimlin ruff check . (or ruff check simlin/ tests/) step to scripts/pysimlin-tests.sh, alongside the existing mypy step.
  2. Separately, fix the two pre-existing E501 violations in src/pysimlin/tests/test_json_types.py (lines 139 and 161) so that adding the gate does not immediately fail.

These two changes should land together (or the fix first, then the gate) to avoid a red pipeline.

Discovery context

Identified during Vensim macro-support implementation work on the macros branch. Out of scope for that task; filed as tech debt for separate follow-up. Confirmed no duplicate exists in GitHub issues (searched: ruff, pysimlin, E501 line-too-long, pysimlin lint gate ci, lint CI pre-commit) or in docs/tech-debt.md (entry #19 concerns the same file but a different root cause: slow Hypothesis input generation, not a missing lint gate).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions