Skip to content

fix: preserve reports for duplicate basenames - #39

Open
mikemikimike wants to merge 1 commit into
ferrix-lab:mainfrom
mikemikimike:issue-24-reporter-fixes
Open

fix: preserve reports for duplicate basenames#39
mikemikimike wants to merge 1 commit into
ferrix-lab:mainfrom
mikemikimike:issue-24-reporter-fixes

Conversation

@mikemikimike

Copy link
Copy Markdown

Summary / Problem

Closes #24.

Reports were named only from the source basename, so files such as pkg_a/user.py and pkg_b/user.py overwrote each other and left duplicate links in summary.md.

Changes

  • Add a shared report filename helper that sanitizes the normalized source path into a flat, unique report name.
  • Use the same generated name when writing per-file reports and when generating summary links.
  • Add a regression test proving that same-basename files retain both report contents and distinct summary links.

Tests

  • .venv\\Scripts\\python.exe -m pytest --basetemp=.pytest-tmp-full tests/ -q — 1 passed.
  • .venv\\Scripts\\python.exe -m py_compile setup.py insight\\__init__.py insight\\analyzer.py insight\\cli.py insight\\detector.py insight\\reporter.py insight\\utils.py — passed.
  • .venv\\Scripts\\python.exe -c "import insight" — passed.
  • Ruff check and format check for tests\\test_reporter.py — passed.
  • Targeted Ruff check for insight\\reporter.py with the pre-existing I001 finding excluded — passed.

Compatibility / Known limitations

The report contents and summary metrics are unchanged; only report filenames and corresponding links are made path-specific. The upstream baseline currently reports existing Ruff findings, including the historical formatting/import finding in insight/reporter.py; no unrelated cleanup is included here.

Issue link

#24

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.

fix(reporter): Report file name collisions cause silent overwrites for files with identical basenames

1 participant