Skip to content

chore: restore the quality gate (mypy, toolchain pins, CI checks, format) - #142

Open
Fszta wants to merge 5 commits into
mainfrom
chore/quality-gate
Open

Fszta wants to merge 5 commits into
mainfrom
chore/quality-gate

Conversation

@Fszta

@Fszta Fszta commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Restores the repository's quality gate, which had drifted: mypy was failing on main, CI ran neither type-check nor format-check, the mypy config pointed at the pre-rename package name, and the formatter/linter versions disagreed between the lockfile, the dev deps, and the pre-commit hooks.

Changes

  • Fix the type errors on main. Type the dominant-reason pick, expose get_model_config on the ProjectMetadataProvider protocol (both concrete registries already implement it), narrow a parser return type to the literals it emits, and correct a handful of test type issues. poetry run type-check now exits 0.
  • Point mypy at the parrant package. [tool.mypy].files still named the old dbt_column_lineage package, so bare mypy checked nothing under the source tree.
  • Pin the toolchain. Pin black, ruff, and mypy to the exact resolved versions and lift the .pre-commit-config.yaml revs to match, so local runs, hooks, and CI share one definition of "clean". Adopts ruff's current default rule set with an explicit ignore list for the rules this codebase violates deliberately (fail-safe blind-excepts, return-code-forwarding subprocess wrappers) — worth a look during review.
  • Gate CI on it. Adds type-check, black --check, and ruff check steps to the test workflow.
  • One-time repo-wide format as the final, separate commit — mechanical output of the pinned toolchain (no hand edits), verified idempotent and behavior-preserving (full suite identical before/after).

Merge order

Merge after #141. The final style: commit here was generated against the current tree; once #141 lands it must be regenerated so it also covers that PR's new code. It is intentionally regenerable — drop it and rerun on the merged base:

poetry run format && poetry run format && poetry run test

(the first run applies fixes and exits non-zero; the second must be a no-op)

🤖 Generated with Claude Code

Fszta and others added 5 commits September 27, 2026 23:00
- service.py: type the partial-edges reason list as List[str] so the
  dominant-reason pick returns str, and expose get_model_config on the
  ProjectMetadataProvider protocol (both concrete registries already
  implement it) so the LineageAndMetadataProvider seam matches its use.
- sql_parser.py: narrow _phantom_token_reason's return type to the two
  Literal reasons it actually emits, matching UnresolvedColumnEdge.
- tests: pass str paths to ManifestReader, add the fake provider's
  get_model_config, and type-ignore the path-injected _build fixture
  imports (deliberately outside mypy's module map).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
[tool.mypy].files still named dbt_column_lineage, the pre-rename
package, so bare mypy checked nothing under the source tree. Bare
mypy now matches poetry run type-check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pin black 25.12.0, ruff 0.16.3, and mypy 1.19.1 exactly in the dev
dependencies (the versions the lockfile had already resolved to) and
lift the .pre-commit-config.yaml revs (black 24.10.0 / ruff v0.8.4 /
mypy v1.15.0) to the same versions, so local runs, hooks, and CI share
one definition of clean.

Also make that definition explicit for ruff: adopt 0.16's default rule
set with a policy ignore list for the rules this codebase violates on
purpose (fail-safe blind excepts, returncode-forwarding subprocess
wrappers).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add mypy (poetry run type-check), black --check (line length 100), and
ruff check (no --fix) steps to the test workflow, before the test
tiers. The format gates go green with the follow-up one-time repo-wide
style commit on this branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical output of the pinned toolchain over the whole repo: black
25.12.0 plus ruff 0.16.3 --fix --unsafe-fixes (1894 fixes, mostly
UP006/UP045 pyupgrade rewrites). No hand edits. Verified idempotent (a
second run is a no-op) and behavior-preserving: mypy clean and the full
suite identical before and after (760 passed, 1 skipped).

Regenerable: if this commit conflicts at merge time, drop it and rerun
on merged main:

    poetry run format && poetry run format && poetry run test

(first run applies fixes and exits non-zero via --exit-non-zero-on-fix;
the second must be a no-op)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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