Skip to content

improve: fix author name and add multi-line export list detection#41

Open
Coding-Dev-Tools wants to merge 18 commits into
masterfrom
improve/deadcode-20260624-160935
Open

improve: fix author name and add multi-line export list detection#41
Coding-Dev-Tools wants to merge 18 commits into
masterfrom
improve/deadcode-20260624-160935

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Automated improvement by dev-engineer. Changes:

  • Fix author name in pyproject.toml (DevForge -> Revenue Holdings)
  • Fix multi-line export list detection in scanner.py (handle comments, aliases, multi-line blocks)
  • Add comprehensive test coverage for multi-line export lists (5 new tests)
  • Update CLI edge case tests to use CliRunner instead of subprocess
  • Add cowork-auto-pr workflow for automated PR creation

Coding-Dev-Tools and others added 7 commits May 26, 2026 15:23
scanner.py: _EXPORT_LIST_PATTERN was applied line-by-line, so multi-line
export blocks like:

    export {
      Foo,
      Bar,
    }

were silently missed — Foo and Bar were never added to the exports map
and thus never flagged as unused exports (false negatives).

Fix: apply _EXPORT_LIST_PATTERN to the full file content (re.DOTALL added
for clarity; [^}] already matched newlines). Line number computed via
content.count('\n', 0, m.start()) + 1 so findings still point to the
opening 'export {' line. Single-line export { Foo, Bar } behaviour is
unchanged.

Add TestMultiLineExportList (4 tests) covering: multi-line detection,
used-name suppression, alias handling, single-line regression.
…h TestMultiLineExportList and master test suites)
…ocess tests

- Strip // comments from multi-line export lists so exports after commented
  entries are no longer silently missed (_parse_exports in scanner.py).
- Replace sys.executable subprocess probes in test_cli_edge_cases.py with
  CliRunner so the suite passes regardless of editable-install state.
- Add regression test for inline comments inside export { } blocks.
@github-actions

Copy link
Copy Markdown

🤖 Automated Code Review

✅ Ruff Lint — No issues

⚠️ Ruff Format — Formatting needed

Would reformat: conftest.py
Would reformat: src/deadcode/__main__.py
Would reformat: src/deadcode/cli.py
Would reformat: src/deadcode/config.py
Would reformat: src/deadcode/scanner.py
Would reformat: tests/test_cli_edge_cases.py
Would reformat: tests/test_config_and_fixes.py
Would reformat: tests/test_scanner.py
8 files would be reformatted, 1 file already formatted

🔴 Secret Detection — 2 potential secret(s)

  .git/FETCH_HEAD:30 — Hex High Entropy String
  .ruff_cache/CACHEDIR.TAG:1 — Hex High Entropy String

✅ Large Files — Within limits

📊 Diff Stats — 2 file(s) changed

 pyproject.toml |   2 +-
 uv.lock        | 432 ---------------------------------------------------------
 2 files changed, 1 insertion(+), 433 deletions(-)

Verdict: 🔴 Changes Requested — Potential secrets detected. Do not merge.

Automated by Coding-Dev-Tools/.github reusable workflow.

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