Commit aa1810a
chore: copyright standardization and optional license fallback (#50)
* cowork-bot: standardize copyright holder to 2025 Coding-Dev-Tools (was Revenue Holdings / stale 2026 year); W-directed fleet-wide pass
* chore: standardize license and package metadata; scanner/test fixes
* cowork-bot: treat type-only named imports as used in dead-code scan
* cowork-bot: treat re-exports (barrel/index forwarding) as used in dead-code scan
Named (`export { X } from './mod'`), renamed (`export { X as Y }`),
type (`export { type X }`), and star (`export * from './mod'`) re-exports
now mark the forwarded symbols as used, so barrel/index files no longer
produce false-positive 'unused_export' findings flagged removable=True
(which could delete live public API). Resolves `export *` specifiers to
scanned files (incl. directory index.*). Adds TestReexportForwarding
(8 cases) + removes a pre-existing F841 unused var. 113 tests pass, ruff clean.
* cowork-bot: fix import parsing in scanner — handle import type {Foo}, mixed default+named imports, and correct group-index reversal
- Rewrote _IMPORT_PATTERN regex to handle: import type {Foo}, import Default, {Named},
import {type Foo}, and import Foo as Bar forms
- Fixed _parse_imports group-number reversal (group 1 = named imports block, group 2 = default)
- Strips 'type ' prefix from named import entries in both named-block positions
- All 113 existing tests pass; ruff clean
* cowork-bot: treat namespace imports (import * as NS) and bare side-effect imports as whole-module consumption
A namespace binding (import * as Utils from './utils') or a bare side-effect
import (import './polyfill') consumes the target module's entire export
surface. The scanner previously ignored both forms entirely, so exports used
ONLY through them were falsely reported as unused with removable=True — live
code queued for deletion by 'deadcode remove'. Both now resolve like barrel
star-reexports: the resolved module's exports are treated as used. Bare
package specifiers stay unresolvable and keep flagging.
+5 regression tests (namespace, export * as ns, side-effect, bare-specifier,
no-consumer control). Full suite: 121 passed, ruff clean.
* cowork-bot: restore working tree dropped by malformed previous commit
The previous commit (2ef1848) was built from a stale temp index and
accidentally recorded deletions of 34 unrelated tracked files. This commit
restores the full tree of 30e09bb while keeping the intended scanner fix
(namespace/side-effect imports as whole-module consumption) and its 5
regression tests. No force-push used.
* cowork-bot: re-add namespace/side-effect import consumption lost by checkout-index
efa7ce2 restored the tree but its checkout-index step reverted
src/deadcode/scanner.py to the pre-fix version. This commit re-applies the
scanner fix from 2ef1848: import * as NS / bare side-effect imports consume
the target module's whole export surface (resolves like barrel star-reexports).
Final tree vs master-base 30e09bb = exactly scanner.py fix + 5-test file.
* cowork-bot: dynamic import() and require() now consume target module's whole export surface (previously invisible -> exports used only via lazy loading flagged removable=True); +3 regression tests
---------
Co-authored-by: DevForge Engineer <engineer@devforge.dev>
Co-authored-by: cowork-bot <bot@coding-dev-tools.local>1 parent 77edf21 commit aa1810a
2 files changed
Lines changed: 153 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
123 | 148 | | |
124 | 149 | | |
125 | 150 | | |
| |||
404 | 429 | | |
405 | 430 | | |
406 | 431 | | |
407 | | - | |
| 432 | + | |
408 | 433 | | |
409 | 434 | | |
410 | 435 | | |
411 | 436 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
415 | 442 | | |
416 | 443 | | |
417 | 444 | | |
| |||
430 | 457 | | |
431 | 458 | | |
432 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
433 | 471 | | |
434 | 472 | | |
435 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
0 commit comments