Skip to content

Have a way to require type annotations #3853

Description

@murali42

Is your feature request related to a problem?

Having type annotations makes the code more understandable.
Having a way to require methods have type annotations would be a great start.

Describe the solution you'd like

An option which enforces presence of type annotations.
Where should they be present?

  • Methods: All/public only
  • Variables: all/public/constant
    For methods.. What part of the signature should the enforcement be for?
  • arguments? return type? (of course self should be exempt)
    Any standard set of exemptions?
  • methods with certain decorators may be exempt (eg. @OverRide implementation of an method from parent class?)

Additional context

This should be opt-in, i.e. disabled by default (for backward compatibility), so individuals can enable it on a per-file basis (or a flag to pylint binary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    CheckersRelated to a checkerEnhancement ✨Improvement to a componentHigh priorityIssue with more than 10 reactionsNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationtyping

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions