Skip to content

Commit e51f37c

Browse files
committed
.
1 parent 0cdd6fa commit e51f37c

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

examples/delete_dead_code/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ pip install codegen
5151
python run.py
5252
```
5353

54+
## Example Output
55+
56+
```
57+
� Deleting dead code...
58+
59+
🗑️ Removing unused function: _get_parser_doc
60+
🧹 Removing unused variable: decoded
61+
🧹 Removing unused variable: shebang_line
62+
...
63+
🧹 Removing unused variable: _
64+
65+
🔧 Total functions removed: 2
66+
📦 Total variables removed: 240
67+
```
68+
69+
5470
## Learn More
5571

5672
- [Deleting Dead Code](https://docs.codegen.com/tutorials/deleting-dead-code)

examples/delete_dead_code/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ def run(codebase: Codebase):
3030
var_assignments.remove()
3131
removed_variables_count += 1
3232

33-
print(f"Total functions removed: {removed_functions_count}")
34-
print(f"Total variables removed: {removed_variables_count}")
33+
print("\n")
34+
print(f"🔧 Total functions removed: {removed_functions_count}")
35+
print(f"📦 Total variables removed: {removed_variables_count}")
3536

3637

3738
if __name__ == "__main__":
3839
print("🔍 Analyzing codebase...")
3940
codebase = Codebase.from_repo("tox-dev/tox", programming_language=ProgrammingLanguage.PYTHON)
4041

41-
print("🚀 Running analysis...")
42+
print("🚮 Deleting dead code...")
4243
run(codebase)

0 commit comments

Comments
 (0)