[ty] Fix override of final method summary (#21681)

This commit is contained in:
Matthew Mckee 2025-11-28 16:18:22 +00:00 committed by GitHub
parent 0084e94f78
commit b5b4917d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1636,7 +1636,7 @@ declare_lint! {
/// def foo(self): ... # Error raised here
/// ```
pub(crate) static OVERRIDE_OF_FINAL_METHOD = {
summary: "detects subclasses of final classes",
summary: "detects overrides of final methods",
status: LintStatus::stable("0.0.1-alpha.29"),
default_level: Level::Error,
}

2
ty.schema.json generated
View File

@ -864,7 +864,7 @@
]
},
"override-of-final-method": {
"title": "detects subclasses of final classes",
"title": "detects overrides of final methods",
"description": "## What it does\nChecks for methods on subclasses that override superclass methods decorated with `@final`.\n\n## Why is this bad?\nDecorating a method with `@final` declares to the type checker that it should not be\noverridden on any subclass.\n\n## Example\n\n```python\nfrom typing import final\n\nclass A:\n @final\n def foo(self): ...\n\nclass B(A):\n def foo(self): ... # Error raised here\n```",
"default": "error",
"oneOf": [