unref 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unref-0.2.2/.github/workflows/ci.yml +156 -0
- {unref-0.2.0 → unref-0.2.2}/.github/workflows/release.yml +9 -9
- unref-0.2.2/.github/workflows/util/setup_python/action.yml +41 -0
- {unref-0.2.0 → unref-0.2.2}/.gitignore +3 -0
- {unref-0.2.0 → unref-0.2.2}/.readthedocs.yaml +2 -1
- {unref-0.2.0 → unref-0.2.2}/CONTRIBUTING.md +5 -17
- {unref-0.2.0 → unref-0.2.2}/Cargo.lock +1 -1
- {unref-0.2.0 → unref-0.2.2}/Cargo.toml +6 -1
- {unref-0.2.0 → unref-0.2.2}/PKG-INFO +26 -39
- unref-0.2.2/README.md +62 -0
- unref-0.2.2/assets/benchmark.svg +1 -0
- {unref-0.2.0 → unref-0.2.2}/docs/configuration.md +112 -19
- {unref-0.2.0 → unref-0.2.2}/docs/index.md +9 -8
- {unref-0.2.0 → unref-0.2.2}/docs/rules.md +2 -1
- {unref-0.2.0 → unref-0.2.2}/linters/cspell/words.txt +20 -0
- {unref-0.2.0 → unref-0.2.2}/linters/ty.toml +1 -1
- {unref-0.2.0 → unref-0.2.2}/linters/unref.toml +2 -3
- {unref-0.2.0 → unref-0.2.2}/prek.toml +1 -1
- {unref-0.2.0 → unref-0.2.2}/pyproject.toml +4 -0
- unref-0.2.2/scripts/benchmark.py +199 -0
- unref-0.2.2/scripts/ecosystem.py +111 -0
- unref-0.2.2/src/classes.rs +434 -0
- {unref-0.2.0 → unref-0.2.2}/src/config.rs +198 -63
- {unref-0.2.0 → unref-0.2.2}/src/definitions.rs +20 -11
- {unref-0.2.0 → unref-0.2.2}/src/discover.rs +9 -12
- {unref-0.2.0 → unref-0.2.2}/src/engine.rs +453 -125
- {unref-0.2.0 → unref-0.2.2}/src/external.rs +17 -11
- {unref-0.2.0 → unref-0.2.2}/src/files.rs +10 -25
- unref-0.2.2/src/frameworks.rs +1094 -0
- {unref-0.2.0 → unref-0.2.2}/src/ignores.rs +42 -39
- {unref-0.2.0 → unref-0.2.2}/src/main.rs +22 -35
- {unref-0.2.0 → unref-0.2.2}/src/models.rs +91 -19
- unref-0.2.2/src/references.rs +1359 -0
- {unref-0.2.0 → unref-0.2.2}/src/symbols.rs +6 -7
- unref-0.2.2/tests/_cli/_files.py +26 -0
- unref-0.2.2/tests/_cli/test_config.py +452 -0
- unref-0.2.2/tests/_cli/test_environment.py +150 -0
- {unref-0.2.0 → unref-0.2.2}/tests/_cli/test_general.py +61 -39
- {unref-0.2.0 → unref-0.2.2}/tests/_cli/test_output.py +20 -79
- {unref-0.2.0 → unref-0.2.2}/tests/_unref.py +11 -3
- unref-0.2.2/tests/cases/columns/ascii.py +2 -0
- unref-0.2.2/tests/cases/columns/cp1252.py +2 -0
- unref-0.2.2/tests/cases/columns/euc_jp.py +2 -0
- unref-0.2.2/tests/cases/columns/utf8.py +2 -0
- unref-0.2.2/tests/cases/config_in_parent/pyproject.toml +9 -0
- unref-0.2.2/tests/cases/config_in_parent/scripts/tool.py +6 -0
- unref-0.2.2/tests/cases/config_in_parent/src/app/cli.py +6 -0
- unref-0.2.2/tests/cases/config_in_parent/src/app/skip.py +2 -0
- unref-0.2.2/tests/cases/definitions/property_setter.py +15 -0
- unref-0.2.2/tests/cases/definitions/type_alias.py +26 -0
- unref-0.2.2/tests/cases/external_compiled_star/.venv/lib/python3.15/site-packages/pkg/dotted.py +3 -0
- unref-0.2.2/tests/cases/external_compiled_star/.venv/lib/python3.15/site-packages/pkg/stable.py +3 -0
- unref-0.2.2/tests/cases/external_compiled_star/.venv/lib/python3.15/site-packages/pkg/tagged.py +3 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_compiled_star/.venv/pyvenv.cfg +1 -1
- unref-0.2.2/tests/cases/external_compiled_star/main.py +41 -0
- unref-0.2.2/tests/cases/external_environment/.venv/pythonpath/project_only/types.py +7 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_environment/.venv/pyvenv.cfg +1 -1
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_environment/main.py +3 -3
- unref-0.2.2/tests/cases/external_missing_star/.venv/lib/python3.15/site-packages/pkg/__init__.py +3 -0
- unref-0.2.2/tests/cases/external_missing_star/.venv/lib/python3.15/site-packages/pkg/optional.py +2 -0
- unref-0.2.2/tests/cases/external_missing_star/.venv/lib/python3.15/site-packages/pkg/other.py +5 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic → unref-0.2.2/tests/cases/external_missing_star}/.venv/pyvenv.cfg +1 -1
- unref-0.2.2/tests/cases/external_missing_star/main.py +20 -0
- unref-0.2.2/tests/cases/external_missing_star/pyproject.toml +3 -0
- unref-0.2.2/tests/cases/frameworks_dataclasses/models.py +115 -0
- unref-0.2.2/tests/cases/frameworks_django/manage.py +16 -0
- unref-0.2.2/tests/cases/frameworks_django/mysite/asgi.py +11 -0
- unref-0.2.2/tests/cases/frameworks_django/mysite/base.py +5 -0
- unref-0.2.2/tests/cases/frameworks_django/mysite/settings.py +14 -0
- unref-0.2.2/tests/cases/frameworks_django/mysite/urls.py +12 -0
- unref-0.2.2/tests/cases/frameworks_django/mysite/wsgi.py +8 -0
- unref-0.2.2/tests/cases/frameworks_django/other/settings.py +3 -0
- unref-0.2.2/tests/cases/frameworks_django/other/urls.py +2 -0
- unref-0.2.2/tests/cases/frameworks_django/polls/apps.py +20 -0
- unref-0.2.2/tests/cases/frameworks_django/polls/urls.py +12 -0
- unref-0.2.2/tests/cases/frameworks_django/polls/views.py +6 -0
- unref-0.2.2/tests/cases/frameworks_django_settings/config/settings/__init__.py +0 -0
- unref-0.2.2/tests/cases/frameworks_django_settings/config/settings/local.py +2 -0
- unref-0.2.2/tests/cases/frameworks_django_settings/config/settings/production.py +5 -0
- unref-0.2.2/tests/cases/frameworks_django_settings/config/urls.py +1 -0
- unref-0.2.2/tests/cases/frameworks_django_settings/pyproject.toml +2 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_fastapi/main.py +0 -9
- unref-0.2.2/tests/cases/frameworks_fastapi/test_local.py +90 -0
- unref-0.2.2/tests/cases/frameworks_flask/app.py +112 -0
- unref-0.2.2/tests/cases/frameworks_flask/cli.py +79 -0
- unref-0.2.2/tests/cases/frameworks_flask/views.py +49 -0
- unref-0.2.2/tests/cases/frameworks_flask/wsgi.py +17 -0
- unref-0.2.2/tests/cases/frameworks_pydantic/.venv/bin/python +0 -0
- unref-0.2.2/tests/cases/frameworks_pydantic/.venv/pyvenv.cfg +3 -0
- unref-0.2.2/tests/cases/frameworks_selected/docs/conf.py +7 -0
- unref-0.2.2/tests/cases/frameworks_selected/models.py +16 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_selected/pyproject.toml +2 -0
- unref-0.2.2/tests/cases/frameworks_sphinx/docs/conf.py +36 -0
- unref-0.2.2/tests/cases/frameworks_sphinx/other/conf.py +6 -0
- unref-0.2.2/tests/cases/frameworks_sphinx/settings.py +3 -0
- unref-0.2.2/tests/cases/frameworks_sphinx_configuration/docs/source/conf.py +10 -0
- unref-0.2.2/tests/cases/frameworks_sphinx_configuration/other/conf.py +3 -0
- unref-0.2.2/tests/cases/frameworks_sphinx_configuration/pyproject.toml +2 -0
- unref-0.2.2/tests/cases/hidden_directory/pkg/__init__.py +0 -0
- unref-0.2.2/tests/cases/imports/function_only_imported.py +1 -0
- unref-0.2.2/tests/cases/imports/import_from_module.py +5 -0
- unref-0.2.2/tests/cases/imports/import_from_package.py +4 -0
- unref-0.2.2/tests/cases/imports/import_lazy.py +8 -0
- unref-0.2.2/tests/cases/imports/import_lazy_helpers.py +10 -0
- unref-0.2.2/tests/cases/imports/import_lazy_other.py +6 -0
- unref-0.2.0/tests/cases/import_star/main.py → unref-0.2.2/tests/cases/imports/import_star.py +1 -1
- unref-0.2.2/tests/cases/imports/import_star_scope.py +4 -0
- unref-0.2.2/tests/cases/imports/import_star_scope_helpers.py +24 -0
- unref-0.2.2/tests/cases/imports/import_star_with_all.py +3 -0
- unref-0.2.2/tests/cases/imports/reexport_same_name.py +4 -0
- unref-0.2.2/tests/cases/local_scopes/class_body_read.py +29 -0
- unref-0.2.2/tests/cases/local_scopes/local_comprehension_unpacking.py +10 -0
- unref-0.2.2/tests/cases/local_scopes/local_function.py +43 -0
- unref-0.2.2/tests/cases/local_scopes/local_function_closure.py +40 -0
- unref-0.2.2/tests/cases/local_scopes/local_function_global.py +10 -0
- unref-0.2.2/tests/cases/local_scopes/local_function_nonlocal.py +62 -0
- unref-0.2.2/tests/cases/match_class_pattern/pyproject.toml +3 -0
- unref-0.2.2/tests/cases/member_receivers/member_class.py +10 -0
- unref-0.2.2/tests/cases/member_receivers/member_external_base.py +23 -0
- unref-0.2.2/tests/cases/member_receivers/member_metaclass.py +17 -0
- unref-0.2.2/tests/cases/member_receivers/member_mixin.py +22 -0
- unref-0.2.2/tests/cases/member_receivers/member_name_imported.py +4 -0
- unref-0.2.2/tests/cases/member_receivers/member_name_imported_jobs.py +10 -0
- unref-0.2.2/tests/cases/member_receivers/member_name_read.py +24 -0
- unref-0.2.2/tests/cases/member_receivers/member_private_helper.py +19 -0
- unref-0.2.2/tests/cases/member_receivers/member_protocol.py +21 -0
- unref-0.2.2/tests/cases/member_receivers/member_self.py +28 -0
- unref-0.2.2/tests/cases/member_receivers/member_super.py +22 -0
- unref-0.2.2/tests/cases/member_receivers/member_template_method.py +24 -0
- unref-0.2.2/tests/cases/member_receivers/member_unknown_base.py +27 -0
- unref-0.2.2/tests/cases/member_receivers/member_unknown_receiver.py +29 -0
- unref-0.2.2/tests/cases/member_receivers/same_name_elsewhere.py +18 -0
- unref-0.2.2/tests/cases/member_receivers/shapes/__init__.py +1 -0
- unref-0.2.2/tests/cases/member_receivers/shapes/models.py +23 -0
- unref-0.2.2/tests/cases/namespace_package/pkg/__init__.py +0 -0
- unref-0.2.2/tests/cases/override_base_class/star_cycle.py +14 -0
- unref-0.2.2/tests/cases/override_base_class/stars/__init__.py +3 -0
- unref-0.2.2/tests/cases/override_base_class/stars/first.py +1 -0
- unref-0.2.2/tests/cases/override_base_class/stars/second.py +7 -0
- unref-0.2.2/tests/cases/override_base_class_external/vendored/__init__.py +0 -0
- unref-0.2.2/tests/cases/override_class_decorator/pyproject.toml +7 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_class_decorator_and_base_class/pyproject.toml +4 -0
- unref-0.2.2/tests/cases/package/pkg/__init__.py +0 -0
- unref-0.2.2/tests/cases/package/pkg/sub/__init__.py +0 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_annotation.py +20 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_annotation_nested.py +50 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_annotation_self.py +23 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_cast.py +19 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_plain_string.py +14 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_type_alias.py +48 -0
- unref-0.2.2/tests/cases/quoted_annotations/quoted_type_var.py +36 -0
- unref-0.2.2/tests/cases/standard_library/.venv/lib/python3.13/handlers.py +3 -0
- unref-0.2.2/tests/cases/standard_library/.venv/lib/python3.13/os.py +0 -0
- unref-0.2.2/tests/cases/standard_library/.venv/lib/python3.14/handlers.py +3 -0
- unref-0.2.2/tests/cases/standard_library/.venv/lib/python3.14/os.py +0 -0
- unref-0.2.2/tests/cases/standard_library/main.py +14 -0
- unref-0.2.2/tests/cases/standard_library/pyproject.toml +3 -0
- unref-0.2.2/tests/cases/syntax_error/undecodable.txt +3 -0
- unref-0.2.2/tests/cases/syntax_error/unknown_encoding.txt +2 -0
- unref-0.2.0/tests/cases/used_only_by_unused/main.py → unref-0.2.2/tests/cases/transitive/used_only_by_unused.py +2 -2
- unref-0.2.0/tests/cases/used_only_by_unused_star/main.py → unref-0.2.2/tests/cases/transitive/used_only_by_unused_star.py +2 -2
- unref-0.2.2/tests/cases/transitive/used_only_by_unused_star_helpers.py +4 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/used_name/main.py +5 -0
- unref-0.2.2/tests/cases/used_name/pyproject.toml +9 -0
- unref-0.2.0/tests/cases/dummy_variable/main.py → unref-0.2.2/tests/cases/variables/dummy_variable.py +1 -1
- unref-0.2.0/tests/cases/underscore/main.py → unref-0.2.2/tests/cases/variables/underscore.py +1 -1
- unref-0.2.2/tests/cases/variables/variable_for_loop.py +15 -0
- unref-0.2.2/tests/cases/variables/variable_walrus.py +23 -0
- unref-0.2.2/tests/cases/variables/variable_with.py +26 -0
- {unref-0.2.0 → unref-0.2.2}/tests/test_cases.py +14 -6
- {unref-0.2.0 → unref-0.2.2}/uv.lock +243 -1
- {unref-0.2.0 → unref-0.2.2}/zensical.toml +0 -1
- unref-0.2.0/.github/workflows/ci.yml +0 -89
- unref-0.2.0/.github/workflows/util/setup_python/action.yml +0 -48
- unref-0.2.0/README.md +0 -76
- unref-0.2.0/docs/recipes.md +0 -27
- unref-0.2.0/scripts/benchmark.py +0 -75
- unref-0.2.0/src/classes.rs +0 -283
- unref-0.2.0/src/frameworks.rs +0 -513
- unref-0.2.0/src/references.rs +0 -834
- unref-0.2.0/tests/_cli/test_config.py +0 -403
- unref-0.2.0/tests/_cli/test_environment.py +0 -114
- unref-0.2.0/tests/cases/external_compiled_star/main.py +0 -20
- unref-0.2.0/tests/cases/function_only_imported/main.py +0 -1
- unref-0.2.0/tests/cases/import_from_module/main.py +0 -5
- unref-0.2.0/tests/cases/import_from_package/main.py +0 -4
- unref-0.2.0/tests/cases/import_star_with_all/main.py +0 -3
- unref-0.2.0/tests/cases/override_class_decorator/pyproject.toml +0 -3
- unref-0.2.0/tests/cases/reexport_same_name/main.py +0 -4
- unref-0.2.0/tests/cases/same_name_elsewhere/main.py +0 -14
- unref-0.2.0/tests/cases/used_name/pyproject.toml +0 -2
- unref-0.2.0/tests/cases/used_only_by_unused_star/helpers.py +0 -4
- {unref-0.2.0 → unref-0.2.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {unref-0.2.0 → unref-0.2.2}/.github/actionlint.yaml +0 -0
- {unref-0.2.0 → unref-0.2.2}/.pre-commit-hooks.yaml +0 -0
- {unref-0.2.0 → unref-0.2.2}/LICENSE +0 -0
- {unref-0.2.0 → unref-0.2.2}/linters/cspell.json +0 -0
- {unref-0.2.0 → unref-0.2.2}/linters/mypy.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/linters/ruff.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/linters/taplo.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/linters/yamllint.yaml +0 -0
- {unref-0.2.0 → unref-0.2.2}/scripts/release.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/src/modules.rs +0 -0
- {unref-0.2.0 → unref-0.2.2}/src/positions.rs +0 -0
- {unref-0.2.0 → unref-0.2.2}/src/transitive.rs +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/_cli/__init__.py +0 -0
- /unref-0.2.0/tests/cases/all_exports/main.py → /unref-0.2.2/tests/cases/all_exports/all_exports.py +0 -0
- /unref-0.2.0/tests/cases/all_exports_forms/main.py → /unref-0.2.2/tests/cases/all_exports/all_exports_forms.py +0 -0
- /unref-0.2.0/tests/cases/all_exports_forms/annotated.py → /unref-0.2.2/tests/cases/all_exports/all_exports_forms_annotated.py +0 -0
- /unref-0.2.0/tests/cases/all_exports_not_strings/main.py → /unref-0.2.2/tests/cases/all_exports/all_exports_not_strings.py +0 -0
- /unref-0.2.0/tests/cases/string_not_in_all/main.py → /unref-0.2.2/tests/cases/all_exports/string_not_in_all.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/ast_node_visitor/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/helpers.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/local.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/pkg/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/pkg/mod.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/pkg/other.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/pkg/sibling.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/attribute_of_module/pkg/third.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/columns/latin1.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/columns/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/compiled_submodule_star/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/compiled_submodule_star/pkg/__init__.py +0 -0
- {unref-0.2.0/tests/cases/entry_points/pkg → unref-0.2.2/tests/cases/config_in_parent/src/app}/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/decorated_function/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/default_excluded/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/default_excluded/node_modules/use.py +0 -0
- /unref-0.2.0/tests/cases/assignment_to_other_object/main.py → /unref-0.2.2/tests/cases/definitions/assignment_to_other_object.py +0 -0
- /unref-0.2.0/tests/cases/attribute_read/main.py → /unref-0.2.2/tests/cases/definitions/attribute_read.py +0 -0
- /unref-0.2.0/tests/cases/class/main.py → /unref-0.2.2/tests/cases/definitions/class_.py +0 -0
- /unref-0.2.0/tests/cases/class_attribute/main.py → /unref-0.2.2/tests/cases/definitions/class_attribute.py +0 -0
- /unref-0.2.0/tests/cases/method_called/main.py → /unref-0.2.2/tests/cases/definitions/method_called.py +0 -0
- /unref-0.2.0/tests/cases/method_without_self/main.py → /unref-0.2.2/tests/cases/definitions/method_without_self.py +0 -0
- /unref-0.2.0/tests/cases/name_read/main.py → /unref-0.2.2/tests/cases/definitions/name_read.py +0 -0
- /unref-0.2.0/tests/cases/nested_function/main.py → /unref-0.2.2/tests/cases/definitions/nested_function.py +0 -0
- /unref-0.2.0/tests/cases/recursive_function/main.py → /unref-0.2.2/tests/cases/definitions/recursive_function.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/dummy_variable_rgx/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/dummy_variable_rgx/pyproject.toml +0 -0
- /unref-0.2.0/tests/cases/dunder_function/main.py → /unref-0.2.2/tests/cases/dunders/dunder_function.py +0 -0
- /unref-0.2.0/tests/cases/dunder_method/main.py → /unref-0.2.2/tests/cases/dunders/dunder_method.py +0 -0
- /unref-0.2.0/tests/cases/dunder_variable/main.py → /unref-0.2.2/tests/cases/dunders/dunder_variable.py +0 -0
- /unref-0.2.0/tests/cases/not_dunder/main.py → /unref-0.2.2/tests/cases/dunders/not_dunder.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/empty_file/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/entry_points/main.py +0 -0
- {unref-0.2.0/tests/cases/external_base_class_nested/vendored → unref-0.2.2/tests/cases/entry_points/pkg}/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/entry_points/pkg/gui.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/entry_points/pkg/plugins.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/entry_points/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/enum_members/enums.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/enum_members/fruits/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/enum_members/fruits/enums.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/enum_members/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/generated/deep/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/generated/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/pkg/generated/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude/single.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/node_modules/use.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/pkg/fixtures/use.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/scripts/keep.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/exclude_patterns/scripts/one.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class/reexport.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_getattr/lazy.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_getattr/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_getattr/not_lazy.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_nested/lazy.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_nested/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_nested/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_nested/reexport.py +0 -0
- {unref-0.2.0/tests/cases/external_environment/.venv/lib/python3.14/site-packages/project_only → unref-0.2.2/tests/cases/external_base_class_nested/vendored}/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_base_class_nested/vendored/outer.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_compiled_star/.venv/bin/python +0 -0
- {unref-0.2.0/tests/cases/external_compiled_star/.venv/lib/python3.14 → unref-0.2.2/tests/cases/external_compiled_star/.venv/lib/python3.15}/site-packages/pkg/__init__.py +0 -0
- {unref-0.2.0/tests/cases/external_compiled_star/.venv/lib/python3.14 → unref-0.2.2/tests/cases/external_compiled_star/.venv/lib/python3.15}/site-packages/pkg/other.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_compiled_star/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_environment/.venv/bin/python +0 -0
- {unref-0.2.0/tests/cases/external_environment/.venv/lib/python3.14 → unref-0.2.2/tests/cases/external_environment/.venv/lib/python3.15}/site-packages/editable.pth +0 -0
- {unref-0.2.0/tests/cases/hidden_directory/pkg → unref-0.2.2/tests/cases/external_environment/.venv/lib/python3.15/site-packages/project_only}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/external_environment/.venv/lib/python3.14 → unref-0.2.2/tests/cases/external_environment/.venv/lib/python3.15}/site-packages/project_only/types.py +0 -0
- {unref-0.2.0/tests/cases/external_environment/.venv/lib/python3.14 → unref-0.2.2/tests/cases/external_environment/.venv/lib/python3.15}/site-packages/unreadable.pth/README.txt +0 -0
- {unref-0.2.0/tests/cases/namespace_package/pkg → unref-0.2.2/tests/cases/external_environment/.venv/pythonpath/project_only}/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_environment/.venv/src/editable_module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/external_environment/pyproject.toml +0 -0
- {unref-0.2.0/tests/cases/override_base_class_external/vendored → unref-0.2.2/tests/cases/frameworks_django/mysite}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/package/pkg → unref-0.2.2/tests/cases/frameworks_django/other}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/package/pkg/sub → unref-0.2.2/tests/cases/frameworks_django/polls}/__init__.py +0 -0
- /unref-0.2.0/tests/cases/frameworks_pydantic/.venv/bin/python → /unref-0.2.2/tests/cases/frameworks_django_settings/config/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_fastapi/routers.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/__init__.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/deprecated/class_validators.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/fields.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/functional_serializers.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/functional_validators.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/main.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/v1/__init__.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic/v1/main.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic_settings/__init__.py +0 -0
- {unref-0.2.0/tests/cases/frameworks_pydantic/.venv/lib/python3.14 → unref-0.2.2/tests/cases/frameworks_pydantic/.venv/lib/python3.15}/site-packages/pydantic_settings/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pydantic/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/bases.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/helpers.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/tests/conftest.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/tests/module_test.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/tests/test_asyncio.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/tests/test_inheritance.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_pytest/tests/test_module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_selected/test_module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_sqlalchemy/chained.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_sqlalchemy/legacy.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_sqlalchemy/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_sqlalchemy/other.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_unittest/base.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_unittest/checks.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_unittest/mixins.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/frameworks_unittest/testsuite.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/function/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/.gitignore +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/generated/use.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/nested/.gitignore +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/nested/scratch_nested.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/scratch_kept.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/gitignore/scratch_one.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/hidden_directory/.github/scripts/run.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/hidden_directory/pkg/util.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/ignore_comment/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/ignore_comment/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/ignore_comment/without_comment.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/ignore_comment_invalid/main.py +0 -0
- /unref-0.2.0/tests/cases/function_only_imported/helpers.py → /unref-0.2.2/tests/cases/imports/function_only_imported_helpers.py +0 -0
- /unref-0.2.0/tests/cases/import_from_module/helpers.py → /unref-0.2.2/tests/cases/imports/import_from_module_helpers.py +0 -0
- /unref-0.2.0/tests/cases/import_from_module/other.py → /unref-0.2.2/tests/cases/imports/import_from_module_other.py +0 -0
- {unref-0.2.0/tests/cases/import_from_package/pkg → unref-0.2.2/tests/cases/imports/import_from_package_pkg}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/import_from_package/pkg → unref-0.2.2/tests/cases/imports/import_from_package_pkg}/module.py +0 -0
- {unref-0.2.0/tests/cases/import_relative/pkg → unref-0.2.2/tests/cases/imports/import_relative_pkg}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/import_relative/pkg → unref-0.2.2/tests/cases/imports/import_relative_pkg}/helpers.py +0 -0
- {unref-0.2.0/tests/cases/import_relative/pkg → unref-0.2.2/tests/cases/imports/import_relative_pkg}/sub/__init__.py +0 -0
- {unref-0.2.0/tests/cases/import_relative/pkg → unref-0.2.2/tests/cases/imports/import_relative_pkg}/sub/module.py +0 -0
- /unref-0.2.0/tests/cases/import_star/helpers.py → /unref-0.2.2/tests/cases/imports/import_star_helpers.py +0 -0
- /unref-0.2.0/tests/cases/import_star_with_all/helpers.py → /unref-0.2.2/tests/cases/imports/import_star_with_all_helpers.py +0 -0
- /unref-0.2.0/tests/cases/import_unresolved/main.py → /unref-0.2.2/tests/cases/imports/import_unresolved.py +0 -0
- /unref-0.2.0/tests/cases/import_unresolved/other.py → /unref-0.2.2/tests/cases/imports/import_unresolved_other.py +0 -0
- {unref-0.2.0/tests/cases/reexport_same_name/pkg → unref-0.2.2/tests/cases/imports/reexport_same_name_pkg}/__init__.py +0 -0
- {unref-0.2.0/tests/cases/reexport_same_name/pkg → unref-0.2.2/tests/cases/imports/reexport_same_name_pkg}/colors.py +0 -0
- {unref-0.2.0/tests/cases/reexport_same_name/pkg → unref-0.2.2/tests/cases/imports/reexport_same_name_pkg}/tool.py +0 -0
- /unref-0.2.0/tests/cases/same_name_in_other_module/main.py → /unref-0.2.2/tests/cases/imports/same_name_in_other_module.py +0 -0
- /unref-0.2.0/tests/cases/same_name_in_other_module/other.py → /unref-0.2.2/tests/cases/imports/same_name_in_other_module_other.py +0 -0
- /unref-0.2.0/tests/cases/local_class_body/main.py → /unref-0.2.2/tests/cases/local_scopes/local_class_body.py +0 -0
- /unref-0.2.0/tests/cases/local_closure/main.py → /unref-0.2.2/tests/cases/local_scopes/local_closure.py +0 -0
- /unref-0.2.0/tests/cases/local_comprehension/main.py → /unref-0.2.2/tests/cases/local_scopes/local_comprehension.py +0 -0
- /unref-0.2.0/tests/cases/local_default/main.py → /unref-0.2.2/tests/cases/local_scopes/local_default.py +0 -0
- /unref-0.2.0/tests/cases/local_global/main.py → /unref-0.2.2/tests/cases/local_scopes/local_global.py +0 -0
- /unref-0.2.0/tests/cases/local_import/main.py → /unref-0.2.2/tests/cases/local_scopes/local_import.py +0 -0
- /unref-0.2.0/tests/cases/local_lambda/main.py → /unref-0.2.2/tests/cases/local_scopes/local_lambda.py +0 -0
- /unref-0.2.0/tests/cases/local_match/main.py → /unref-0.2.2/tests/cases/local_scopes/local_match.py +0 -0
- /unref-0.2.0/tests/cases/local_parameter/main.py → /unref-0.2.2/tests/cases/local_scopes/local_parameter.py +0 -0
- /unref-0.2.0/tests/cases/local_targets/main.py → /unref-0.2.2/tests/cases/local_scopes/local_targets.py +0 -0
- /unref-0.2.0/tests/cases/local_variable/main.py → /unref-0.2.2/tests/cases/local_scopes/local_variable.py +0 -0
- /unref-0.2.0/tests/cases/local_variable_read/main.py → /unref-0.2.2/tests/cases/local_scopes/local_variable_read.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/match_class_pattern/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/method/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/namespace_package/pkg/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/namespace_package/pkg/sub/deeper/mod.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/namespace_package/pkg/sub/mod.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/namespace_package/top/inner/mod.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/namespace_package/top/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/non_python_file/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/non_python_file/notes.txt +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override/conftest.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override/src/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override/tests/test_module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override/tests/unit/test_unit.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/children.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/cycle_first.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/cycle_second.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/pkg/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/pkg/base.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_and_path/models/model.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_and_path/other.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_and_path/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_external/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_external/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_external/vendored/base.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_external/vendored/broken.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_base_class_external/vendored/namespace/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_class_decorator/decorators.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_class_decorator/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/override_class_decorator_and_base_class/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/package/pkg/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/package/pkg/sub/module.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/reexport_cycle/first/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/reexport_cycle/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/reexport_cycle/second/__init__.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/reexport_cycle/second/values.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/syntax_error/bad.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/syntax_error/good.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/syntax_warning/main.py +0 -0
- /unref-0.2.0/tests/cases/transitive/main.py → /unref-0.2.2/tests/cases/transitive/transitive.py +0 -0
- /unref-0.2.0/tests/cases/used_only_by_unused/helpers.py → /unref-0.2.2/tests/cases/transitive/used_only_by_unused_helpers.py +0 -0
- /unref-0.2.0/tests/cases/used_only_by_unused_star/star.py → /unref-0.2.2/tests/cases/transitive/used_only_by_unused_star_star.py +0 -0
- /unref-0.2.0/tests/cases/used_only_by_unused_star/star_used.py → /unref-0.2.2/tests/cases/transitive/used_only_by_unused_star_star_used.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/typed_dict/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/typed_dict/models.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/used_decorator/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/used_decorator/pyproject.toml +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/used_only_by_unused_root/main.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/cases/used_only_by_unused_root/pyproject.toml +0 -0
- /unref-0.2.0/tests/cases/instance_attribute/main.py → /unref-0.2.2/tests/cases/variables/instance_attribute.py +0 -0
- /unref-0.2.0/tests/cases/instance_attribute_declared/main.py → /unref-0.2.2/tests/cases/variables/instance_attribute_declared.py +0 -0
- /unref-0.2.0/tests/cases/variable/main.py → /unref-0.2.2/tests/cases/variables/variable.py +0 -0
- /unref-0.2.0/tests/cases/variable_in_block/main.py → /unref-0.2.2/tests/cases/variables/variable_in_block.py +0 -0
- /unref-0.2.0/tests/cases/variable_only_written/main.py → /unref-0.2.2/tests/cases/variables/variable_only_written.py +0 -0
- /unref-0.2.0/tests/cases/variable_reassigned/main.py → /unref-0.2.2/tests/cases/variables/variable_reassigned.py +0 -0
- /unref-0.2.0/tests/cases/variable_unpacking/main.py → /unref-0.2.2/tests/cases/variables/variable_unpacking.py +0 -0
- {unref-0.2.0 → unref-0.2.2}/tests/pytest.ini +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
# A new push to a PR supersedes its in-flight run; manual runs are never cancelled.
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
linters:
|
|
16
|
+
name: Linters
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
|
|
21
|
+
- name: Setup Python
|
|
22
|
+
uses: ./.github/workflows/util/setup_python
|
|
23
|
+
|
|
24
|
+
- name: prek cache
|
|
25
|
+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
26
|
+
with:
|
|
27
|
+
path: ~/.cache/prek
|
|
28
|
+
key: ci-prek-cache-${{ hashFiles('prek.toml') }}
|
|
29
|
+
|
|
30
|
+
- name: Run prek
|
|
31
|
+
run: prek run -v --show-diff-on-failure --color=always --all-files
|
|
32
|
+
|
|
33
|
+
docs:
|
|
34
|
+
name: Docs
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
38
|
+
|
|
39
|
+
- name: Setup Python
|
|
40
|
+
uses: ./.github/workflows/util/setup_python
|
|
41
|
+
|
|
42
|
+
- name: Build docs
|
|
43
|
+
run: uv run --group docs zensical build --strict
|
|
44
|
+
|
|
45
|
+
type-check:
|
|
46
|
+
name: Type Checks
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
50
|
+
|
|
51
|
+
- uses: ./.github/workflows/util/setup_python
|
|
52
|
+
with:
|
|
53
|
+
install-project: "false"
|
|
54
|
+
|
|
55
|
+
- name: Run mypy
|
|
56
|
+
run: mypy --config-file linters/mypy.toml .
|
|
57
|
+
|
|
58
|
+
- name: Run ty
|
|
59
|
+
run: ty check --project . --config-file linters/ty.toml
|
|
60
|
+
|
|
61
|
+
unit-tests:
|
|
62
|
+
name: Unit Tests
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
66
|
+
|
|
67
|
+
- uses: ./.github/workflows/util/setup_python
|
|
68
|
+
|
|
69
|
+
- name: Run Rust unit tests
|
|
70
|
+
run: cargo test --locked
|
|
71
|
+
|
|
72
|
+
# The tests of the command run the unref that the setup installs in the environment.
|
|
73
|
+
- name: Run tests of the command
|
|
74
|
+
run: pytest --showlocals -c tests/pytest.ini
|
|
75
|
+
|
|
76
|
+
compare:
|
|
77
|
+
name: Compare with main
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
permissions:
|
|
80
|
+
contents: read
|
|
81
|
+
pull-requests: write
|
|
82
|
+
steps:
|
|
83
|
+
# A pull request is checked out as its merge into the current main, which is the merge's first parent. The
|
|
84
|
+
# base SHA of the event can be an older main, whose later commits would count as changes of the PR. A manual
|
|
85
|
+
# run compares the branch it runs on with main.
|
|
86
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
87
|
+
with:
|
|
88
|
+
fetch-depth: 2
|
|
89
|
+
|
|
90
|
+
- name: Checkout the base
|
|
91
|
+
env:
|
|
92
|
+
EVENT: ${{ github.event_name }}
|
|
93
|
+
run: |
|
|
94
|
+
if [ "$EVENT" = "pull_request" ]; then
|
|
95
|
+
base=HEAD^1
|
|
96
|
+
else
|
|
97
|
+
git fetch --depth=1 origin main
|
|
98
|
+
base=FETCH_HEAD
|
|
99
|
+
fi
|
|
100
|
+
git worktree add --detach base "$base"
|
|
101
|
+
git -C base log -1 --format='Base: %h %s'
|
|
102
|
+
|
|
103
|
+
- uses: ./.github/workflows/util/setup_python
|
|
104
|
+
with:
|
|
105
|
+
install-project: "false"
|
|
106
|
+
|
|
107
|
+
- name: Rust cache
|
|
108
|
+
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
109
|
+
with:
|
|
110
|
+
workspaces: |
|
|
111
|
+
. -> target
|
|
112
|
+
base -> target
|
|
113
|
+
|
|
114
|
+
- name: Build the head and the base
|
|
115
|
+
run: |
|
|
116
|
+
cargo build --release --locked
|
|
117
|
+
cargo build --release --locked --manifest-path base/Cargo.toml
|
|
118
|
+
|
|
119
|
+
# Shows the findings that the head adds or removes on open source projects. It never fails the job, not even
|
|
120
|
+
# when a project cannot be cloned.
|
|
121
|
+
- name: Compare the findings on open source projects
|
|
122
|
+
continue-on-error: true
|
|
123
|
+
run: python scripts/ecosystem.py base/target/release/unref target/release/unref ecosystem.md
|
|
124
|
+
|
|
125
|
+
# Fails when the head is too slow, after it writes its report, which the next steps then still post.
|
|
126
|
+
- name: Compare the speed
|
|
127
|
+
run: python scripts/benchmark.py compare base/target/release/unref target/release/unref benchmark.md
|
|
128
|
+
|
|
129
|
+
- name: Write the report and the job summary
|
|
130
|
+
if: ${{ !cancelled() }}
|
|
131
|
+
run: |
|
|
132
|
+
for file in benchmark.md ecosystem.md; do
|
|
133
|
+
if [ -f "$file" ]; then cat "$file"; echo; fi
|
|
134
|
+
done > report.md
|
|
135
|
+
cat report.md >> "$GITHUB_STEP_SUMMARY"
|
|
136
|
+
|
|
137
|
+
# A pull request from a fork has a read-only token, so it gets the job summary only.
|
|
138
|
+
- name: Comment on the pull request
|
|
139
|
+
if: >-
|
|
140
|
+
${{ !cancelled() && hashFiles('benchmark.md', 'ecosystem.md') != '' && github.event_name == 'pull_request'
|
|
141
|
+
&& github.event.pull_request.head.repo.full_name == github.repository }}
|
|
142
|
+
uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5
|
|
143
|
+
with:
|
|
144
|
+
header: compare
|
|
145
|
+
path: report.md
|
|
146
|
+
|
|
147
|
+
check:
|
|
148
|
+
name: Check All
|
|
149
|
+
if: always()
|
|
150
|
+
needs: [linters, docs, type-check, unit-tests, compare]
|
|
151
|
+
runs-on: ubuntu-latest
|
|
152
|
+
steps:
|
|
153
|
+
- name: Decide whether the needed jobs succeeded or failed
|
|
154
|
+
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
|
|
155
|
+
with:
|
|
156
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
if: runner.os == 'Windows'
|
|
35
35
|
run: git config --global core.longpaths true
|
|
36
36
|
|
|
37
|
-
- uses: actions/checkout@v7
|
|
37
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
38
38
|
|
|
39
39
|
- name: Set the version from the tag
|
|
40
40
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
@@ -42,13 +42,13 @@ jobs:
|
|
|
42
42
|
run: sed -i.bak "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml
|
|
43
43
|
|
|
44
44
|
- name: Build the wheel
|
|
45
|
-
uses: PyO3/maturin-action@v1.51.0
|
|
45
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
46
46
|
with:
|
|
47
47
|
target: ${{ matrix.target }}
|
|
48
48
|
manylinux: ${{ matrix.manylinux }}
|
|
49
49
|
args: --release --out dist
|
|
50
50
|
|
|
51
|
-
- uses: actions/upload-artifact@v7.0.2
|
|
51
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
52
52
|
with:
|
|
53
53
|
name: wheel-${{ matrix.runner }}-${{ matrix.target }}
|
|
54
54
|
path: dist
|
|
@@ -57,19 +57,19 @@ jobs:
|
|
|
57
57
|
name: Source distribution
|
|
58
58
|
runs-on: ubuntu-latest
|
|
59
59
|
steps:
|
|
60
|
-
- uses: actions/checkout@v7
|
|
60
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
61
61
|
|
|
62
62
|
- name: Set the version from the tag
|
|
63
63
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
64
64
|
run: sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml
|
|
65
65
|
|
|
66
66
|
- name: Build the source distribution
|
|
67
|
-
uses: PyO3/maturin-action@v1.51.0
|
|
67
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
68
68
|
with:
|
|
69
69
|
command: sdist
|
|
70
70
|
args: --out dist
|
|
71
71
|
|
|
72
|
-
- uses: actions/upload-artifact@v7.0.2
|
|
72
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
73
73
|
with:
|
|
74
74
|
name: sdist
|
|
75
75
|
path: dist
|
|
@@ -87,19 +87,19 @@ jobs:
|
|
|
87
87
|
contents: write
|
|
88
88
|
|
|
89
89
|
steps:
|
|
90
|
-
- uses: actions/download-artifact@v8.0.2
|
|
90
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
91
91
|
with:
|
|
92
92
|
path: dist
|
|
93
93
|
merge-multiple: true
|
|
94
94
|
|
|
95
95
|
- name: Setup uv
|
|
96
|
-
uses: astral-sh/setup-uv@v10.3.3
|
|
96
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
97
97
|
|
|
98
98
|
- name: Publish to PyPI
|
|
99
99
|
run: uv publish --trusted-publishing always dist/*
|
|
100
100
|
|
|
101
101
|
- name: Create GitHub Release
|
|
102
|
-
uses: softprops/action-gh-release@v3
|
|
102
|
+
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
|
|
103
103
|
with:
|
|
104
104
|
generate_release_notes: true
|
|
105
105
|
files: dist/*
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Setup Python
|
|
2
|
+
description: Install Python, uv and dependencies, which builds unref unless asked not to.
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
python-version:
|
|
6
|
+
description: Python version to install.
|
|
7
|
+
default: "3.15"
|
|
8
|
+
install-project:
|
|
9
|
+
description: Whether to build and install unref. Jobs that only check the Python code do not need it.
|
|
10
|
+
default: "true"
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: "composite"
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup uv
|
|
16
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ inputs.python-version }}
|
|
19
|
+
enable-cache: true
|
|
20
|
+
|
|
21
|
+
# The Rust toolchain of the runner builds unref, whose build is cached.
|
|
22
|
+
- name: Rust cache
|
|
23
|
+
if: inputs.install-project == 'true'
|
|
24
|
+
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
25
|
+
|
|
26
|
+
- name: Install Python dependencies
|
|
27
|
+
shell: bash
|
|
28
|
+
env:
|
|
29
|
+
INSTALL_PROJECT: ${{ inputs.install-project }}
|
|
30
|
+
run: |
|
|
31
|
+
if [ "$INSTALL_PROJECT" = "true" ]; then
|
|
32
|
+
uv sync --frozen
|
|
33
|
+
else
|
|
34
|
+
uv sync --frozen --no-install-project
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Put the project virtual environment on PATH for subsequent steps, so tools can be
|
|
38
|
+
# invoked directly (e.g. `pytest`).
|
|
39
|
+
- name: Activate Python venv
|
|
40
|
+
shell: bash
|
|
41
|
+
run: echo "$(pwd)/.venv/bin" >> "$GITHUB_PATH"
|
|
@@ -3,12 +3,13 @@ version: 2
|
|
|
3
3
|
|
|
4
4
|
build:
|
|
5
5
|
os: ubuntu-24.04
|
|
6
|
+
# Read the Docs does not offer Python 3.15 yet, so its Python only installs uv, which installs 3.15.
|
|
6
7
|
tools:
|
|
7
8
|
python: "3.14"
|
|
8
9
|
jobs:
|
|
9
10
|
install:
|
|
10
11
|
- pip install uv
|
|
11
|
-
- uv sync --frozen --only-group docs
|
|
12
|
+
- uv sync --frozen --only-group docs --python 3.15
|
|
12
13
|
build:
|
|
13
14
|
html:
|
|
14
15
|
- uv run --no-sync zensical build --strict
|
|
@@ -44,29 +44,17 @@ UNREF_BINARY=target/debug/unref uv run pytest -c tests/pytest.ini tests
|
|
|
44
44
|
### Test cases
|
|
45
45
|
|
|
46
46
|
The behavior of the check is tested with case projects. Each directory under `tests/cases` is a small
|
|
47
|
-
Python project, and `tests/test_cases.py` runs the check on each of them.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
as the assertions of ty's tests do:
|
|
47
|
+
Python project on one theme, and `tests/test_cases.py` runs the check on each of them. A finding is
|
|
48
|
+
expected with an `# expect:` comment on its line, and the docstring of `tests/test_cases.py` gives the
|
|
49
|
+
full syntax:
|
|
51
50
|
|
|
52
51
|
```python
|
|
53
52
|
def unused(): # expect: 5 [unused-function]
|
|
54
53
|
return 1
|
|
55
54
|
```
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```python
|
|
60
|
-
first, second = 1, 2 # expect: 1 [unused-variable], 8 [unused-variable]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
The comment can follow another comment on the line, such as a `# type: ignore[...]`.
|
|
64
|
-
|
|
65
|
-
The findings must match exactly, so a line without the comment must not have a finding. To test a new
|
|
66
|
-
behavior, add a directory with the files that show it.
|
|
67
|
-
|
|
68
|
-
A case is configured with a `pyproject.toml` in its directory, as a project is, which also gives its
|
|
69
|
-
entry points.
|
|
56
|
+
To test a new behavior, add files to the case whose theme fits. Add a new directory only when the case
|
|
57
|
+
needs its own `pyproject.toml` or layout.
|
|
70
58
|
|
|
71
59
|
### Type checks
|
|
72
60
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "unref"
|
|
3
3
|
# The release workflow sets the version from the tag that it releases.
|
|
4
|
-
version = "0.2.
|
|
4
|
+
version = "0.2.2"
|
|
5
5
|
edition = "2024"
|
|
6
6
|
rust-version = "1.97"
|
|
7
7
|
description = "Find unreferenced Python code"
|
|
@@ -31,6 +31,11 @@ ruff_text_size = { git = "https://github.com/astral-sh/ruff", tag = "0.17.5" }
|
|
|
31
31
|
lto = "fat"
|
|
32
32
|
codegen-units = 16
|
|
33
33
|
|
|
34
|
+
# For the builds of uv, which skip LTO to rebuild in seconds. The binary runs about 10 to 15% slower.
|
|
35
|
+
[profile.local]
|
|
36
|
+
inherits = "release"
|
|
37
|
+
lto = "off"
|
|
38
|
+
|
|
34
39
|
[lints.rust]
|
|
35
40
|
unsafe_code = "forbid"
|
|
36
41
|
unreachable_pub = "warn"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unref
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
13
14
|
Classifier: Programming Language :: Rust
|
|
14
15
|
License-File: LICENSE
|
|
15
16
|
Summary: Find unreferenced Python code
|
|
@@ -29,25 +30,32 @@ Project-URL: repository, https://github.com/Apakottur/unref
|
|
|
29
30
|
|
|
30
31
|
# unref
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
An extremely fast Python dead code finder, written in Rust.
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img alt="Time to check CPython with unref and other dead code finders" src="https://raw.githubusercontent.com/Apakottur/unref/main/assets/benchmark.svg">
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<i>Checking the whole <a href="https://github.com/python/cpython">CPython</a> codebase (v3.15.0, about 2,300 Python files),
|
|
41
|
+
measured with <a href="https://github.com/Apakottur/unref/blob/main/scripts/benchmark.py"><code>scripts/benchmark.py</code></a>.</i>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
- **Fast**: 20x faster than [vulture](https://github.com/jendrikseipp/vulture), it checks all of CPython's Python code in
|
|
45
|
+
under a second.
|
|
46
|
+
- **Just works**: built-in rules for pytest, Pydantic, SQLAlchemy and
|
|
47
|
+
[more](https://unref.readthedocs.io/en/latest/configuration/#frameworks), so most projects need little or no
|
|
48
|
+
configuration.
|
|
49
|
+
- **Accurate**: names are matched by module, so a used `parse` in one module does not hide an unused `parse`
|
|
50
|
+
in another.
|
|
51
|
+
- **Ruff-style**: same conventions, options and output style as [Ruff](https://docs.astral.sh/ruff/), and it
|
|
52
|
+
finds the unused code Ruff leaves out.
|
|
53
|
+
- **Modern**: ty-style rule codes, configuration in `pyproject.toml`, built on Ruff's parser.
|
|
54
|
+
- **Fits your workflow**: runs with `uvx`, as a pre-commit or prek hook, and in GitHub Actions.
|
|
34
55
|
|
|
35
56
|
**Documentation**: [unref.readthedocs.io](https://unref.readthedocs.io/)
|
|
36
57
|
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
Unused code piles up in every codebase, faster than ever now that AI tools write much of it.
|
|
40
|
-
|
|
41
|
-
[Ruff](https://docs.astral.sh/ruff/) does not find unused code yet, see
|
|
42
|
-
[astral-sh/ruff#872](https://github.com/astral-sh/ruff/issues/872). `unref` fills that gap until it does:
|
|
43
|
-
|
|
44
|
-
- **Just works**: built-in rules for pytest, unittest, Pydantic, SQLAlchemy and FastAPI, so most projects need
|
|
45
|
-
little or no configuration.
|
|
46
|
-
- **Ruff-style**: same conventions, options and output style, and it covers what Ruff leaves out.
|
|
47
|
-
- **Fast**: written in Rust on Ruff's parser, it checks all of CPython in under a second.
|
|
48
|
-
- **Modern**: ty-style rule codes and configuration in `pyproject.toml`.
|
|
49
|
-
|
|
50
|
-
## Quick start
|
|
58
|
+
## Getting Started
|
|
51
59
|
|
|
52
60
|
Run it with [`uvx`](https://docs.astral.sh/uv/):
|
|
53
61
|
|
|
@@ -68,32 +76,11 @@ repos:
|
|
|
68
76
|
- id: ruff-check
|
|
69
77
|
- id: ruff-format
|
|
70
78
|
- repo: https://github.com/Apakottur/unref
|
|
71
|
-
rev: v0.
|
|
79
|
+
rev: v0.2.0 # Or run `pre-commit autoupdate`.
|
|
72
80
|
hooks:
|
|
73
81
|
- id: unref
|
|
74
82
|
```
|
|
75
83
|
|
|
76
|
-
## How it works
|
|
77
|
-
|
|
78
|
-
- **Matched by module**: a function, class or variable is used only when its own module reads it, or
|
|
79
|
-
another module reaches it through an import, `module.name` or `__all__`.
|
|
80
|
-
- **Installed base classes**: base classes from the project's environment are followed, so the methods a
|
|
81
|
-
subclass overrides count as used.
|
|
82
|
-
- **Ignore comments by code**: `# unref: ignore[...]` names the rule it ignores, and a comment that ignores
|
|
83
|
-
nothing is reported.
|
|
84
|
-
|
|
85
|
-
## Benchmark
|
|
86
|
-
|
|
87
|
-
Checking the whole [CPython](https://github.com/python/cpython) codebase (v3.14.0, about 2,100 files):
|
|
88
|
-
|
|
89
|
-
| Tool | Time |
|
|
90
|
-
| -------------------------------------------------- | ------ |
|
|
91
|
-
| unref | 0.94s |
|
|
92
|
-
| unref (one thread) | 1.59s |
|
|
93
|
-
| [vulture](https://github.com/jendrikseipp/vulture) | 19.68s |
|
|
94
|
-
|
|
95
|
-
Measured with [`scripts/benchmark.py`](https://github.com/Apakottur/unref/blob/main/scripts/benchmark.py).
|
|
96
|
-
|
|
97
84
|
## Contributing
|
|
98
85
|
|
|
99
86
|
False positives and other bugs are welcome as [issues](https://github.com/Apakottur/unref/issues). To
|
unref-0.2.2/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[](https://pypi.python.org/pypi/unref)
|
|
2
|
+
[](https://github.com/Apakottur/unref/blob/main/LICENSE)
|
|
3
|
+
[](https://pypi.python.org/pypi/unref)
|
|
4
|
+
[](https://unref.readthedocs.io/)
|
|
5
|
+
|
|
6
|
+
# unref
|
|
7
|
+
|
|
8
|
+
An extremely fast Python dead code finder, written in Rust.
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img alt="Time to check CPython with unref and other dead code finders" src="https://raw.githubusercontent.com/Apakottur/unref/main/assets/benchmark.svg">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<i>Checking the whole <a href="https://github.com/python/cpython">CPython</a> codebase (v3.15.0, about 2,300 Python files),
|
|
16
|
+
measured with <a href="https://github.com/Apakottur/unref/blob/main/scripts/benchmark.py"><code>scripts/benchmark.py</code></a>.</i>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
- **Fast**: 20x faster than [vulture](https://github.com/jendrikseipp/vulture), it checks all of CPython's Python code in
|
|
20
|
+
under a second.
|
|
21
|
+
- **Just works**: built-in rules for pytest, Pydantic, SQLAlchemy and
|
|
22
|
+
[more](https://unref.readthedocs.io/en/latest/configuration/#frameworks), so most projects need little or no
|
|
23
|
+
configuration.
|
|
24
|
+
- **Accurate**: names are matched by module, so a used `parse` in one module does not hide an unused `parse`
|
|
25
|
+
in another.
|
|
26
|
+
- **Ruff-style**: same conventions, options and output style as [Ruff](https://docs.astral.sh/ruff/), and it
|
|
27
|
+
finds the unused code Ruff leaves out.
|
|
28
|
+
- **Modern**: ty-style rule codes, configuration in `pyproject.toml`, built on Ruff's parser.
|
|
29
|
+
- **Fits your workflow**: runs with `uvx`, as a pre-commit or prek hook, and in GitHub Actions.
|
|
30
|
+
|
|
31
|
+
**Documentation**: [unref.readthedocs.io](https://unref.readthedocs.io/)
|
|
32
|
+
|
|
33
|
+
## Getting Started
|
|
34
|
+
|
|
35
|
+
Run it with [`uvx`](https://docs.astral.sh/uv/):
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
$ uvx unref
|
|
39
|
+
src/project/models.py:12:7: unused-class 'Account'
|
|
40
|
+
src/project/utils.py:40:5: unused-function 'parse_date'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or as a [pre-commit](https://pre-commit.com/) or [prek](https://prek.j178.dev/) hook, alongside
|
|
44
|
+
[Ruff](https://docs.astral.sh/ruff/):
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
repos:
|
|
48
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
49
|
+
rev: v0.17.4
|
|
50
|
+
hooks:
|
|
51
|
+
- id: ruff-check
|
|
52
|
+
- id: ruff-format
|
|
53
|
+
- repo: https://github.com/Apakottur/unref
|
|
54
|
+
rev: v0.2.0 # Or run `pre-commit autoupdate`.
|
|
55
|
+
hooks:
|
|
56
|
+
- id: unref
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Contributing
|
|
60
|
+
|
|
61
|
+
False positives and other bugs are welcome as [issues](https://github.com/Apakottur/unref/issues). To
|
|
62
|
+
contribute code, see [CONTRIBUTING.md](https://github.com/Apakottur/unref/blob/main/CONTRIBUTING.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="184" viewBox="0 0 640 184" font-family="system-ui, -apple-system, sans-serif" font-size="14"><style>text{fill:#1f2328}.tick{fill:#656d76;font-size:12px}.bar{fill:#d0d7de}.bar.main{fill:#e8a33d}.axis{stroke:#d0d7de}@media (prefers-color-scheme: dark){text{fill:#e6edf3}.tick{fill:#9198a1}.bar{fill:#3d444d}.axis{stroke:#3d444d}}</style><line class="axis" x1="90" y1="162" x2="550" y2="162"/><text x="80" y="27" text-anchor="end" font-weight="bold">unref</text><rect class="bar main" x="90" y="12" width="13.9" height="22" rx="3"/><text x="111.9" y="27" font-weight="bold">0.91s</text><text x="80" y="63" text-anchor="end">vulture</text><rect class="bar" x="90" y="48" width="283.2" height="22" rx="3"/><text x="381.2" y="63">18.47s</text><text x="80" y="99" text-anchor="end">deadcode</text><rect class="bar" x="90" y="84" width="460.0" height="22" rx="3"/><text x="558.0" y="99">>30s</text><text x="80" y="135" text-anchor="end">skylos</text><rect class="bar" x="90" y="120" width="460.0" height="22" rx="3"/><text x="558.0" y="135">>30s</text><text class="tick" x="90.0" y="178" text-anchor="middle">0s</text><text class="tick" x="243.3" y="178" text-anchor="middle">10s</text><text class="tick" x="396.7" y="178" text-anchor="middle">20s</text><text class="tick" x="550.0" y="178" text-anchor="middle">30s</text></svg>
|