Cool project. I think false positives are more important than the dead code it misses at this stage. For example, it marks all Django settings as unused variables, probably because settings are typically not imported directly in Django projects. For example:
from django.conf import settings
...
if settings.DEBUG:
...
Currently unref thinks that DEBUG is not used.
Similarly, the `application` variable in asgi.py (or wsgi.py) is passed as an argument to the ASGI/WSGI server executable, but that is also marked as unused.
LaurensBER 2 hours ago [-]
Thanks, this seems like a very good approach and is indeed very fast! Happy to run this over our codebase and see how it compares against Vulture.
McAvey 44 minutes ago [-]
Great let me know how it goes!
The initial version was in Python which was pretty fast as well, decided to try Rust both for speed and to reuse more constructs from ruff/ty for better compatibility with them.
leobuskin 2 hours ago [-]
All of CPython’s stdlib, right? It’s Python dead code checker, not C.
McAvey 37 minutes ago [-]
Yes, only the Python code (every .py file in the CPython repo).
The benchmark script is in the repo so you can run it yourself, the results are from my potato computer, will probably be even faster on modern PCs.
I've updated the README to be more clear about that, thanks for pointing that out!
olk09oscar 58 minutes ago [-]
[dead]
maxkaya_dev 1 hours ago [-]
[flagged]
gounscrambler 4 hours ago [-]
[flagged]
musicpublisheri 5 hours ago [-]
[flagged]
Rendered at 11:20:12 GMT+0000 (Coordinated Universal Time) with Vercel.
Similarly, the `application` variable in asgi.py (or wsgi.py) is passed as an argument to the ASGI/WSGI server executable, but that is also marked as unused.
The initial version was in Python which was pretty fast as well, decided to try Rust both for speed and to reuse more constructs from ruff/ty for better compatibility with them.
The benchmark script is in the repo so you can run it yourself, the results are from my potato computer, will probably be even faster on modern PCs.
I've updated the README to be more clear about that, thanks for pointing that out!