Skip to content

Commit 4c880c9

Browse files
author
DevForge Engineer
committed
fix: add __main__.py for python -m deadcode support, update changelog and package.json metadata
- Add src/deadcode/__main__.py entry point so 'python -m deadcode' works - Update CHANGELOG.md with 0.1.1 release notes - Fix package.json description (said 'Python projects' but tool targets TS/React) - Clean up dead no-op assertion in test_scan_category_filter
1 parent 32a0ac9 commit 4c880c9

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.1] - 2026-05-18
9+
10+
### Added
11+
- `__main__.py` module for `python -m deadcode` support
12+
13+
### Fixed
14+
- CLI no longer fails when invoked via `python -m deadcode`
15+
816
## [0.1.0] - 2025-05-17
917

1018
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "deadcode-cli",
33
"version": "0.1.0",
4-
"description": "Find unused/dead code in Python projects. Static analysis tool to identify orphaned functions, classes, and imports.",
4+
"description": "Detect and remove unused exports, dead routes, orphaned CSS, and unreferenced components in TypeScript/React/Next.js projects.",
55
"author": "Revenue Holdings <engineering@revenueholdings.dev>",
66
"license": "MIT",
77
"repository": {

src/deadcode/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""DeadCode CLI entry point for `python -m deadcode`."""
2+
from .cli import cli
3+
4+
if __name__ == "__main__":
5+
cli()

tests/test_scanner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ def test_scan_json_output(self, runner, sample_project):
274274
def test_scan_category_filter(self, runner, sample_project):
275275
result = runner.invoke(cli, ["-p", str(sample_project), "scan", "-c", "orphaned_css"])
276276
assert result.exit_code == 0
277-
json.loads(result.output) if "--json-output" in [] else None
278-
# Just check it doesn't crash
279-
assert "Orphaned CSS" in result.output or result.exit_code == 0
277+
# Should only show orphaned CSS findings
278+
assert "Orphaned CSS" in result.output
279+
assert "Unused Exports" not in result.output
280280

281281
def test_scan_nonexistent_dir(self, runner):
282282
result = runner.invoke(cli, ["-p", "/nonexistent/path", "scan"])

0 commit comments

Comments
 (0)