Skip to content

Commit 7c90e1b

Browse files
authored
Fix dead-code false positives for framework/runtime reachability (#29)
* docs(chore): clarification of wording and general reorganization of sections * feat(core): bump package version to 2.0.1b1 and update project deps (uv.lock) * fix(core, ci): update package description and bump GitHub default CodeClone package verion to 2.0.1b1 for current beta line to fix tests errors in CI * fix(core): fixed the FP dead code detector for popular frameworks (FastAPI/Starlette route and dependency registration, Django URL patterns, Dependency Injector providers, Typer/Click commands, and Celery tasks), as well as CI tests. * chore(docs): update project docs * fix(dead-code): avoid Protocol declarations as false positives * test(dead-code): cover explicit ABC inheritance liveness * fix(dead-code): reduce framework and packaging false positives - Teach dead-code analysis about exact runtime liveness surfaces that do not appear as direct calls: FastAPI Annotated dependencies, literal __all__ exports, package entry points, and Pydantic runtime hooks. * chore(deps): update project deps * chore(docs): remove v1 EOL notice from README pages
1 parent 7840f7a commit 7c90e1b

52 files changed

Lines changed: 4535 additions & 921 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/codeclone/_action_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from typing import Literal
2626

2727
COMMENT_MARKER = "<!-- codeclone-report -->"
28-
DEFAULT_CODECLONE_PACKAGE_VERSION = "2.0.0"
28+
DEFAULT_CODECLONE_PACKAGE_VERSION = "2.0.1b1"
2929

3030

3131
@dataclass(frozen=True, slots=True)

.github/actions/codeclone/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ inputs:
1818
package-version:
1919
description: "CodeClone version from PyPI for remote installs (ignored when the action runs from the checked-out CodeClone repo)"
2020
required: false
21-
default: "2.0.0"
21+
default: "2.0.1b1"
2222

2323
path:
2424
description: "Project root"

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ from another doc.** Current values (verified at write time):
144144
|-----------------------------------|-----------------------------------|---------------|
145145
| `BASELINE_SCHEMA_VERSION` | `codeclone/contracts/__init__.py` | `2.1` |
146146
| `BASELINE_FINGERPRINT_VERSION` | `codeclone/contracts/__init__.py` | `1` |
147-
| `CACHE_VERSION` | `codeclone/contracts/__init__.py` | `2.6` |
148-
| `REPORT_SCHEMA_VERSION` | `codeclone/contracts/__init__.py` | `2.10` |
147+
| `CACHE_VERSION` | `codeclone/contracts/__init__.py` | `2.7` |
148+
| `REPORT_SCHEMA_VERSION` | `codeclone/contracts/__init__.py` | `2.11` |
149149
| `METRICS_BASELINE_SCHEMA_VERSION` | `codeclone/contracts/__init__.py` | `1.2` |
150150

151151
When updating any doc that mentions a version, re-read `codeclone/contracts/__init__.py` first. Do not derive

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Dead code
6+
7+
- Add framework-aware runtime reachability for dead-code analysis: FastAPI/Starlette
8+
routes and `Annotated[..., Depends/Security(...)]` dependencies, Django URL patterns,
9+
Dependency Injector providers, Typer/Click commands, Celery tasks, top-level `__all__`
10+
exports, package entry points, and Pydantic validator/serializer hooks. Supported
11+
registrations suppress false dead-code findings without framework execution or
12+
name-only heuristics.
13+
- Treat `typing.Protocol` and `typing_extensions.Protocol` declarations, including
14+
generic `Protocol[T]`, as type-only contracts so structural interfaces do not produce
15+
false-positive dead-code findings.
16+
- Bump cache schema to `2.7` and report schema to `2.11` to carry reachability facts
17+
for cold/warm parity and report explainability.
18+
319
## [2.0.0] - 2026-04-30
420

521
`2.0.0` promotes the completed 2.0 release line to the stable public contract.

0 commit comments

Comments
 (0)