Skip to content

flake8-builtins (A) rules that shouldn't apply to stubs #15293

@Avasam

Description

@Avasam

The following I'm pretty sure should be disabled in stubs, as they are out of a stub author's control:

As for the rest:

  • builtin-import-shadowing (A004) (53 hits in typeshed, nearly all re-exports)
    Very similar as A001 but can actually be worked around with import aliases and re-export aliases. (which would trigger A001 instead)
    Could maybe be ignored in stubs if re-exported ? (import print as print, from tensorflow.math import abs as abs, import foo as print; print = print and import foo as print; __all__= ["print"])
  • builtin-lambda-argument-shadowing (A006)
    I don't think lambdas apply to type stubs anyway. Probably doesn't need to be ignored.

Ruff: 0.8.5

(this report is extracted from #14535 (comment) and #14535 (comment) for ease of tracking and discussion)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions