File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
examples/delete_dead_code Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,22 @@ pip install codegen
5151python 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 )
Original file line number Diff line number Diff 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
3738if __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 )
You can’t perform that action at this time.
0 commit comments