Skip to content

cowork-bot: fix export-list comment masking + repair broken CLI subprocess tests#37

Open
Coding-Dev-Tools wants to merge 6 commits into
masterfrom
cowork/improve-deadcode
Open

cowork-bot: fix export-list comment masking + repair broken CLI subprocess tests#37
Coding-Dev-Tools wants to merge 6 commits into
masterfrom
cowork/improve-deadcode

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Automated improvement PR from the Cowork repo-improver rotation.

Changes:

  • Strip // comments from multi-line export lists so exports after commented entries are no longer silently missed (scanner.py _parse_exports).
  • 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.

Coding-Dev-Tools and others added 6 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.
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