Release notes
v2.6.3
2026-11-13:Bugfixes:
Normalize paths to forward slashes in findings, discovery, fix grouping, and pattern matching
v2.6.2
2026-11-13:Features:
Document a staged Rust accelerator plan for issue #67 and list it in the DEP index
Publish the Deadcode Enhancement Proposal (DEP) process, template, and index.
Add a documentation page planning an experiment on large open source Python projects with candidate repositories, metrics and a measurement protocol.
Add DEP 4 proposing source-code tree pruning, with a survey of the JavaScript bundle-pruning tools that solve it and the capabilities expanding deadcode would require.
Stop reporting type-checker comments such as
# ty: ignoreas commented-out code (DC12).; Add--ignoreto suppress findings by rule code via the CLI,pyproject.tomland pre-commit.Add DEP 5 documenting how an unused definition shadowed by a used name could be detected.
Add DEP 7 documenting native SARIF output support and publish it in the DEP index
Bugfixes:
DEP metadata fields now render on separate lines when viewed on GitHub
v2.6.1
2026-11-11:Features:
Audit runtime and development dependencies for known vulnerabilities in CI on every pull request and weekly.
Declare the package development status as Beta.
Add a Django usage guide covering models, admin, views, forms, middleware, signals and more, plus Django
MIDDLEWAREregistration parsing and Django-aware qualified matching through absolute imports.Django
MIDDLEWAREregistrations are treated as used and absolute-import qualified expressions resolve to their modules.
Bugfixes:
Support boolean flags such as
fix = trueanddry = truein[tool.deadcode]configuration.
v2.6.0
2026-11-08:Features:
Add support for Python 3.13, 3.14 and 3.15.
Documentation is now published on Read the Docs at deadcode.readthedocs.io.
Add
-Vas a short alias for--version.--ignore-definitions-if-decorated-withnow ignores whole decorated definitions--ignore-bodies-ofnow suppresses the bodies of matching classes and functions--ignore-bodies-if-decorated-withnow suppresses the bodies of decorated definitions--ignore-names-if-inherits-fromnow ignores class names matching a base class--ignore-definitionsnow reliably ignores function, method, property and nested class definitions; its limits are documentedAdd a code coverage badge to the README, fed by the coverage report uploaded from CI
Add a CI status badge for the test workflow to the README
Definitions decorated with
@abstractmethodor@overrideare ignored by default (issue #40)Implement DC06 unused names, DC09 unreachable bodies, DC12 commented-out code and DC13 unreachable code rules.
Enforce 100% line coverage of the
deadcodepackage and keep every documented feature mapped to its source and tests.Build the released version, stable and latest documentation automatically when
make publishpublishes a releaseAdd a documentation banner and a usage-section documentation callout to the README
Bugfixes:
Exit with code 1 when unused code is found, so CI jobs and pre-commit hooks can fail.
Fix
--fixleaving invalid or partially removed imports when unused names are deleted from parenthesized or multi-line import statements.Fix
--fixleaving invalid or fragmented imports when removing names from backslash-continued, semicolon-separated, or commented import statements.Fix
--fixleaving the continuation lines of multi-line unused assignments behind and producing invalid Python (issue #26).Do not crash when the terminal cannot encode CLI output, including the success message, warnings and verbose logs.
Fix
deadcode --fixremoving theffrom thefromkeyword in multi-line parenthesized imports (issue #5)Remove fully unused import statements, including multi-line parenthesized ones, without leaving broken syntax behind
Remove only the unused names from partially used import statements while keeping the used names and their order
Honor
# noqacomments on the definition line of decorated functions, methods and classes.Wildcard imports now honour a module
__all__list or tuple, so excluded names are reported as unused. Wildcard imports stay unrestricted when__all__is dynamic or unknown, and explicit imports keep working. Without__all__, wildcard imports expose public module-level names.Honour
--ignore-names-if-decorated-withfor dotted decorators such as@app.route, so route handlers are not reported as unused (issue #30).Decorator names are reported as dotted identifiers such as
@app.getinstead of memory addresses--ignore-names-if-decorated-withnow suppresses decorated functions, methods, properties, and classesPrint verbose log messages as readable ASCII instead of a
bytesrepr when the output stream cannot encode a character.--ignore-bodies-if-inherits-fromand--ignore-definitions-if-inherits-fromnow recognize dotted base classes such asgraphene.ObjectTypeand match their final component.Render decorator names deterministically, including dotted names, and stop unusual decorators such as
@Class().function()from crashing or producing memory addresses.Stop reporting unittest lifecycle methods declared in test files as unused code (issue #21).
Use pytest instead of unittest.TestCase
Fix
ignore-names-if-inherits-fromhaving no effect when set inpyproject.toml; its accepted base-class forms and class-name-only scope are now documented (issue #25)A scalar string in
pyproject.tomlis now honoured as one pattern instead of being split into charactersNames referenced from quoted type annotations (forward references) are no longer reported as unused imports.
Fix
--no-colorleaving colour codes in the success banner; Make--countcount only findings reflected by--only; Make--verboseprint INFO messages about ignored and scanned filesRules now sit under Ignoring checks with noqa comments, the Glossary under Command line options, and Decorator matching is more concise.
Python 3.10+ requirement is now shown as a badge in the README
v2.5.0
2026-11-07: - Stop Codecov report comments on pull requests with no coverage findingsBugfixes:
Fix a crash when a decorator has no
idattribute.
v2.4.1
2024-08-09:Features:
Add
--versionoption to showdeadcodeversion.
Bugfixes:
Use stdout for
deadcodeoutput.
v2.4.0
2024-07-12:Features:
Add
--onlyoption that accepts filenames only which will be reflected in the output and modified. This option can be used with--fixand--fix --dryoptions as well as for simple unused code detection without fixing.
v2.3.2
2024-07-10:Features:
Add
pre-commithook support.Drop support for Python 3.8 and 3.9 versions, since their
astimplementation is lacking features.
v2.3.1
2024-07-03:Bugfixes:
Started analysing files in bytes instead of trying to convert them into UTF-8 encoded strings.
Improved automatic removal of unused imports.
v2.3.0
2024-04-07:Features:
Add
--dryoption.Update error codes to use DCXX format instead of DCXXX.