Skip to content

Commit

Permalink
Add documentation examples for overridden-final-method checker
Browse files Browse the repository at this point in the history
  • Loading branch information
mbyrnepr2 committed Mar 31, 2022
1 parent cb9dc79 commit d11b0c8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/data/messages/o/overridden-final-method/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import final


class Base:
@final
def my_method(self):
pass


class Subclass(Base):
def my_method(self): # [overridden-final-method]
pass
1 change: 1 addition & 0 deletions doc/data/messages/o/overridden-final-method/details.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The message can't be emitted when using Python < 3.8.
12 changes: 12 additions & 0 deletions doc/data/messages/o/overridden-final-method/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import final


class Base:
@final
def my_method(self):
pass


class Subclass(Base):
def my_other_method(self):
pass
1 change: 1 addition & 0 deletions doc/data/messages/o/overridden-final-method/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `PEP 591 <https://peps.python.org/pep-0591/>`_

0 comments on commit d11b0c8

Please sign in to comment.