Repository navigation
Description
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 NoneReproduce:
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.shenforces 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
- Add a
uv run --directory src/pysimlin ruff check .(orruff check simlin/ tests/) step toscripts/pysimlin-tests.sh, alongside the existingmypystep. - 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).
Activity
Add Vensim macro (:MACRO:) support (#564)
build: pysimlin CI/pre-commit now runs `ruff check` (#571)