You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[[package]]
name = "deadcode"
version = "2.2.2"
description = "Find and remove dead code."
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
{file = "deadcode-2.2.2-py3-none-any.whl", hash = "sha256:d8280cf44e224e47e061f9b9963b902c009dc1ba1e43a42623a43ab88e1afa36"},
{file = "deadcode-2.2.2.tar.gz", hash = "sha256:b63e207999667e731212e04f6d48888a2e3f7256e5ee808ba9082af20d99dca0"},
]
Python version:
Python 3.11.7
To reproduce, create the following two files in the same directory:
file1.py:
foo = 1
bar = 2
xyz = 3
file2.py:
from file1 import (
foo,
bar,
xyz
)
from file1 import foo
def fn():
pass
fn()
Run deadcode with --fix
🐍 v3.11.7 (myapp-py3.11)
✗ deadcode ./file2.py --fix
file2.py:1:0: DC007 Import `bar` is never used
file2.py:1:0: DC007 Import `foo` is never used
file2.py:1:0: DC007 Import `xyz` is never used
file2.py:7:0: DC007 Import `foo` is never used
Removed 4 unused code items!
I expect all of the imports to be removed, but this what file2.py looks like afterwards instead:
rom file1 import (
foo,
bar,
xyz
)
def fn():
pass
fn()
It removes the f in from, and doesn't get rid of those imports.
The text was updated successfully, but these errors were encountered:
deadcode version:
Python version:
To reproduce, create the following two files in the same directory:
file1.py:
file2.py:
Run deadcode with
--fix
I expect all of the imports to be removed, but this what
file2.py
looks like afterwards instead:It removes the
f
infrom
, and doesn't get rid of those imports.The text was updated successfully, but these errors were encountered: