cowork-bot: fix export-list comment masking + repair broken CLI subprocess tests#37
Open
Coding-Dev-Tools wants to merge 6 commits into
Open
cowork-bot: fix export-list comment masking + repair broken CLI subprocess tests#37Coding-Dev-Tools wants to merge 6 commits into
Coding-Dev-Tools wants to merge 6 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated improvement PR from the Cowork repo-improver rotation.
Changes: