Skip to content

fix: add file_path, relative_path, and language to dead_code response#481

Open
itxaiohanglover wants to merge 1 commit into
tirth8205:mainfrom
itxaiohanglover:fix/dead-code-response-fields-447
Open

fix: add file_path, relative_path, and language to dead_code response#481
itxaiohanglover wants to merge 1 commit into
tirth8205:mainfrom
itxaiohanglover:fix/dead-code-response-fields-447

Conversation

@itxaiohanglover
Copy link
Copy Markdown

Summary

Fixes #447

  • find_dead_code() now returns file_path, relative_path, and language fields per entry, consistent with other tools like find_large_functions
  • The legacy file key is retained for backward compatibility
  • root parameter is optional — when not provided, relative_path falls back to the absolute path (so suggest_refactorings and other internal callers are unaffected)

Changes

File Change
code_review_graph/refactor.py Added root param to find_dead_code(); enriched output dict with 3 new fields
code_review_graph/tools/refactor_tools.py Pass root from _get_store() to find_dead_code()
tests/test_refactor.py Added 2 tests verifying new fields and fallback behavior

Test plan

  • All 44 existing refactor tests pass (no regressions)
  • New test: test_find_dead_code_response_fields — verifies file_path, relative_path, language, and backward-compat file key
  • New test: test_find_dead_code_relative_path_without_root — verifies fallback when root is not provided
  • ruff check passes with no warnings

🤖 Generated with Claude Code

…tirth8205#447)

find_dead_code() returned only 5 fields per entry while other tools like
find_large_functions return richer data via node_to_dict. Add file_path,
relative_path, and language to bring consistency. The 'file' key is kept
for backward compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

refactor_tool(mode='dead_code'): response items missing documented relative_path / file_path / language fields

1 participant