Skip to content

Feature request: ignore N802 for methods marked with @override #3910

Closed
@Avasam

Description

@Avasam

Same as PyCQA/pep8-naming#215 I think this would be useful whether it is added to pep8-naming or not

Python 3.12 will introduce the override decorator. It is already backported by typing_extensions.

Overridden method names are out of the dev's control when subclassing an external library. A strong example of this is PyQt6/PySide6, where I have to keep adding to ignore-names as I use more and more features. Ruff could understand that there's nothing the dev can do about the names if a method is marked with @override (and it'll still raise anyway on the base class if it's internal).

[tool.ruff.pep8-naming]
# PyQt methods
ignore-names = ["closeEvent", "paintEvent", "keyPressEvent", "mousePressEvent", "mouseMoveEvent", "mouseReleaseEvent"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions