Skip to content

CI: enforce ty type-checking + add pre-commit config (ruff + ty) #119

Closed

Description

@neuromechanist

Currently .github/workflows/ci.yml runs ruff check + ruff format --check
as a hard gate (the lint job), but never runs ty at all -- type-checking is
untested in CI. There is also no .pre-commit-config.yaml in this repo, so
neither tool runs locally pre-commit (per the global dev-standards
pre-commit template).

Scope

  1. Add a ty check . step to the lint job in .github/workflows/ci.yml
    (or a new typecheck job alongside it).
  2. Add .pre-commit-config.yaml with ruff check --fix, ruff format, and
    ty check hooks, scoped to staged files only (per project convention:
    "pre-commit hooks should check staged files only").

Blocker to resolve first

uv run ty check . currently reports ~496 pre-existing diagnostics
across the repo (mostly in pyAMICA/torch_impl/core.py, e.g. self.W/
self.sphere typed as None | Tensor and subscripted/used without narrowing).
Turning ty check into an immediate hard CI gate would fail the build on
main as-is. Options, pick one before wiring the gate:

  • (a) Clean up the existing diagnostics first (likely its own separate,
    larger issue -- torch_impl/core.py is the bulk of them), then gate.
  • (b) Land ty check as informational/non-blocking in CI now (so regressions
    are visible in logs without breaking builds), track cleanup separately,
    flip to blocking once clean.

Not scoping the 496-diagnostic cleanup into this issue; decide (a) vs (b) and
size that work separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions