Skip to content

fix(code-metrics): partial type-debt run on hyphenated same-named modules (#4123) - #4765

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/4123-mypy-collision-partial-37e9
Sep 28, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/4123-mypy-collision-partial-37e9

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Closes #4123

Summary

Type-debt Python lane reports partial (other files measured) when same-named modules collide under hyphenated directories, instead of whole-lane unavailable (triage option 3). code-metrics → 0.3.19.

Fix

  • Pre-hold duplicates by derived module name; CODE_METRICS_PARTIAL_REASON_FILE channel (same as jscpd).
  • Reactive hold-out from mypy duplicate-module line; other exit-2 still unavailable.

Verification

  • test_mypy_report 31 OK; audit-type-debt / dispatch suites; ruff; changelog parity (per implementer)

Related

  • jscpd.py partial-reason channel precedent
Open in Web Open in Cursor 

…al (#4123)

Two same-named files under hyphenated directories (a-dir/mod.py,
b-dir/mod.py) both derive a bare module name, and mypy stopped before
analysis, turning the whole Python lane unavailable. The mypy-report
collector now groups the scope by the derived module name, keeps the
first file of each group (the one mypy itself keeps), measures the rest
of the scope, and writes the held-out files to the partial-reason file
so the run row reads partial. A duplicate only mypy's __init__.py naming
mode produces is held out from mypy's own message and the run repeats.
Any other blocking mypy error still reaches the exit-4 unavailable row.

Adds a real mypy 1.19.1 capture and tests for the stub, the naming-mode
path, and the real mypy.

Co-authored-by: Kyle Sexton <[email protected]>
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body conforms to the issue-linkage contract. Nothing to do.

@cursor
cursor Bot marked this pull request as ready for review September 28, 2026 02:26
@cursor
cursor Bot merged commit c4f4983 into main Sep 28, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/4123-mypy-collision-partial-37e9 branch September 28, 2026 02:38
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.

code-metrics: measure same-named modules under hyphenated directories instead of leaving the Python lane unavailable

2 participants