Skip to content

Ignore specific warnings on specific lines #14630

Closed
@Alex031544

Description

@Alex031544

Feature

Similar to this issue it would be nice to be able to accept deviations from the MyPy checks for special cases. Sometimes there are reasons to solve something this way rather than following the common rule.

Nevertheless, it is important to provide information to code reviewers to help them to understand:

  • which warning (e.g. by using the identifiers of MyPy) is suppressed
  • optional comment
  • it must be easy to find the exceptions/approvals

Pitch

  • adding a line hint:

    class MyTinyClass:  # R0903 : ignore
    
  • adding a line hint with a comment:

    class MyTinyClass:  # R0903 : ignore - No further public methods are required here (Alex)
    
  • adding a line hint with several keys:

    class MyTinyClass:  # R0903,R0915 : ignore
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions