Skip to content

fix(analyzer): recognize declaration-only Python stubs - #801

Merged
duriantaco merged 1 commit into
mainfrom
fix/python-stub-declarations
Sep 6, 2026
Merged

fix(analyzer): recognize declaration-only Python stubs#801
duriantaco merged 1 commit into
mainfrom
fix/python-stub-declarations

Conversation

@duriantaco

Copy link
Copy Markdown
Owner

Summary

  • Keep concrete code and unused imports reportable.
  • Prevent stub declarations from overwriting same-named .py definitions.
  • Preserve alias-shadowing checks when declarations replace imported names.

Tests

pytest test/test_python_stub_declarations.py test/test_visitor.py test/test_pep695_type_params.py
test/test_framework_aware.py test/test_signature_contract_parameters.py test/test_python_api_hallucination.py
test/test_api_signature_hallucination.py test/test_analyzer.py

Exclude non-concrete .pyi declarations from unused-code candidates while retaining binding metadata for alias resolution. Preserve concrete code, unused imports, and same-named runtime definitions.

Add regression coverage for stub declarations, rebinding, and .py/.pyi scan order for issue #787.
@duriantaco
duriantaco merged commit 06b7fc3 into main Sep 6, 2026
13 checks passed
@duriantaco
duriantaco deleted the fix/python-stub-declarations branch September 6, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant