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

Should some (or all) pep8-naming (N) not apply to stubs? #15296

Open
Avasam opened this issue Jan 6, 2025 · 0 comments
Open

Should some (or all) pep8-naming (N) not apply to stubs? #15296

Avasam opened this issue Jan 6, 2025 · 0 comments
Labels
needs-decision Awaiting a decision from a maintainer question Asking for support or clarification rule Implementing or modifying a lint rule

Comments

@Avasam
Copy link
Contributor

Avasam commented Jan 6, 2025

As @harahu mentioned in #14535 (comment), most pep8-naming rules don't apply for third-party stubs

  • But relevant rules could be made to apply to names decorated with @type_check_only, since that's a clear signal the stub author is very likely in control of that name (there's some niche exceptions for when a class is defined inside a function, but needs to be exposed in stubs)
  • N811, N812, N813, N814, N817 are probably fine in stubs, as long as the name isn't re-exported (in __all__, foo as foo or var = var)

Ruff: 0.8.5

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

@dhruvmanila dhruvmanila added the question Asking for support or clarification label Jan 6, 2025
@MichaReiser MichaReiser added rule Implementing or modifying a lint rule needs-decision Awaiting a decision from a maintainer labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer question Asking for support or clarification rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

3 participants