What was flagged?
- File: src/plotly-stubs/basedatatypes.pyi
- Name:
_bracket_re, etc
Why is it a false positive?
Type definitions in PEP 484 .pyi stub files should be treated similarly to how skylos now treats PEP 544 Protocols; exempt from being flagged as unused as long as they are not concrete. This is relevant for the many xxx-stubs repos (like plotly-stubs, where I found this issue) that contain only stub files, and so are not expected to have any concrete implementation.
Skylos version
skylos 4.35.0
Minimal reproduction
Any stub in a file named .pyi, in the example, see e.g.
█ LOW dead-code/variable Unused variable: _bracket_re
Dead Code src/plotly-stubs/basedatatypes.pyi:16
evidence: likely dead — no static references were found [analyzer] · symbol is not exported as public API [analyzer] · no package, framework, test,...
_bracket_re = ...
Fix: Remove the unused variable if it is not public API.
What was flagged?
_bracket_re, etcWhy is it a false positive?
Type definitions in PEP 484
.pyistub files should be treated similarly to how skylos now treats PEP 544 Protocols; exempt from being flagged as unused as long as they are not concrete. This is relevant for the manyxxx-stubsrepos (likeplotly-stubs, where I found this issue) that contain only stub files, and so are not expected to have any concrete implementation.Skylos version
skylos 4.35.0
Minimal reproduction
Any stub in a file named .pyi, in the example, see e.g.