Skip to content

FP: Unused variable findings in PEP 484 .pyi type stub files #787

Description

@mcdigman

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions