deadcode icon indicating copy to clipboard operation
deadcode copied to clipboard

Find and fix unused Python code using command line.

Results 27 deadcode issues
Sort by recently updated
recently updated
newest added

If I pipe to a file the file is empty. What I tried: ```bash deadcode . --exclude=tests,tasks,src/tools --ignore-names-in-files=migrations > deadcode.txt ```

Lovely project! Alas, https://deadcode.readthedocs.io does not resolve to docs.

deadcode version: ``` [[package]] name = "deadcode" version = "2.2.2" description = "Find and remove dead code." category = "dev" optional = false python-versions = ">=3.8" files = [ {file...

With an unused function, this works: ```python def check(arg): # noqa: DC002 pass ``` but this doesn't: ```python @cache def check(arg): # noqa: DC002 pass ``` This works again, but...

Perhaps because of the way we specify routes in FastAPI, when I run deadcode on a FastAPI project it identify nearly everything as dead code. Is there a way to...

Hi, nice project, I really like it! A few things that should be added: ### Tag versions as you release them `.pre-commit-config.yaml` expects a `rev` which is either - a...

I am getting this error when I try to run this command on a directory within Django with just a bunch of Python files with subdirectories. ``` >>> deadcode ....

By default wildcard import imports all the names, which do not start with underscore. However, it is possible to limit names, which might be imported by defining `__all__` variable in...

This fix the issue #22 with the encoding on Wndows 11.

When I run `deadcode.exe .` from the terminal, everything works fine ![grafik](https://github.com/user-attachments/assets/05cda166-827d-4762-a47d-e86de3dc7e1d) But if I run the pre-commit hook I get a `UnicodeEncodeError` ``` deadcode.................................................................Failed - hook id: deadcode -...