Skip to content

feat(deadcode): add unused-symbol detection for changed code#7

Merged
cffls merged 1 commit intomainfrom
dead_code
Apr 28, 2026
Merged

feat(deadcode): add unused-symbol detection for changed code#7
cffls merged 1 commit intomainfrom
dead_code

Conversation

@cffls
Copy link
Copy Markdown
Collaborator

@cffls cffls commented Apr 28, 2026

Flags non-exported functions, top-level vars/consts (Go) and non-exported functions, classes, and module-level variables (TypeScript) that are declared in a diff's changed regions but have no references in their analyzable scope. Reported as WARN since reflective use, framework registration, and codegen can produce false positives. Disable with --skip-deadcode.

Go scope is the package directory (including _test.go files), so test-only usage still counts as used. Methods, types, init/main, and TestXxx/BenchmarkXxx/ExampleXxx/FuzzXxx are skipped because they're either driven by the runtime/test framework or too coarse to track without type info. TypeScript scope is the single file — non-exported TS symbols are file-local — and exported declarations are skipped to avoid guessing about external consumers.

Flags non-exported functions, top-level vars/consts (Go) and
non-exported functions, classes, and module-level variables
(TypeScript) that are declared in a diff's changed regions but have
no references in their analyzable scope. Reported as WARN since
reflective use, framework registration, and codegen can produce
false positives. Disable with --skip-deadcode.

Go scope is the package directory (including _test.go files), so
test-only usage still counts as used. Methods, types, init/main, and
TestXxx/BenchmarkXxx/ExampleXxx/FuzzXxx are skipped because they're
either driven by the runtime/test framework or too coarse to track
without type info. TypeScript scope is the single file — non-exported
TS symbols are file-local — and exported declarations are skipped to
avoid guessing about external consumers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cffls cffls merged commit bc4127e into main Apr 28, 2026
5 checks passed
@cffls cffls deleted the dead_code branch April 28, 2026 15:32
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.

2 participants