Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Avasam opened this issue Jan 6, 2025 · 1 comment
Open

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

Avasam opened this issue Jan 6, 2025 · 1 comment
Labels
rule Implementing or modifying a lint rule

Comments

@Avasam
Copy link
Contributor

Avasam commented Jan 6, 2025

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)

@AlexWaygood
Copy link
Member

builtin-module-shadowing (A005)

This has been tackled in #15350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

3 participants