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: ignore as commented-out code (DC12).; Add --ignore to suppress findings by rule code via the CLI, pyproject.toml and 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 MIDDLEWARE registration parsing and Django-aware qualified matching through absolute imports.

      • Django MIDDLEWARE registrations are treated as used and absolute-import qualified expressions resolve to their modules.

    • Bugfixes:

      • Support boolean flags such as fix = true and dry = true in [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 -V as a short alias for --version.

      • --ignore-definitions-if-decorated-with now ignores whole decorated definitions

      • --ignore-bodies-of now suppresses the bodies of matching classes and functions

      • --ignore-bodies-if-decorated-with now suppresses the bodies of decorated definitions

      • --ignore-names-if-inherits-from now ignores class names matching a base class

      • --ignore-definitions now reliably ignores function, method, property and nested class definitions; its limits are documented

      • Add 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 @abstractmethod or @override are 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 deadcode package and keep every documented feature mapped to its source and tests.

      • Build the released version, stable and latest documentation automatically when make publish publishes a release

      • Add 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 --fix leaving invalid or partially removed imports when unused names are deleted from parenthesized or multi-line import statements.

      • Fix --fix leaving invalid or fragmented imports when removing names from backslash-continued, semicolon-separated, or commented import statements.

      • Fix --fix leaving 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 --fix removing the f from the from keyword 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 # noqa comments 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-with for 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.get instead of memory addresses

      • --ignore-names-if-decorated-with now suppresses decorated functions, methods, properties, and classes

      • Print verbose log messages as readable ASCII instead of a bytes repr when the output stream cannot encode a character.

      • --ignore-bodies-if-inherits-from and --ignore-definitions-if-inherits-from now recognize dotted base classes such as graphene.ObjectType and 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-from having no effect when set in pyproject.toml; its accepted base-class forms and class-name-only scope are now documented (issue #25)

      • A scalar string in pyproject.toml is now honoured as one pattern instead of being split into characters

      • Names referenced from quoted type annotations (forward references) are no longer reported as unused imports.

      • Fix --no-color leaving colour codes in the success banner; Make --count count only findings reflected by --only; Make --verbose print INFO messages about ignored and scanned files

      • Rules 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 findings

    • Bugfixes:

      • Fix a crash when a decorator has no id attribute.

  • v2.4.1 2024-08-09:

    • Features:

      • Add --version option to show deadcode version.

    • Bugfixes:

      • Use stdout for deadcode output.

  • v2.4.0 2024-07-12:

    • Features:

      • Add --only option that accepts filenames only which will be reflected in the output and modified. This option can be used with --fix and --fix --dry options as well as for simple unused code detection without fixing.

  • v2.3.2 2024-07-10:

    • Features:

      • Add pre-commit hook support.

      • Drop support for Python 3.8 and 3.9 versions, since their ast implementation 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 --dry option.

      • Update error codes to use DCXX format instead of DCXXX.