Skip to content

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

@Avasam

Description

@Avasam

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainerquestionAsking for support or clarificationruleImplementing 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