## Summary
As noted on #30660, this should be the actual final entry in the rename
stack, doing some internal cleanup on file, module, and function names
not covered by the previous rename PRs, which focused on the rule
structs themselves.
As the last PR in the stack, this closes#27011, which in turn closes
#1773.
## Summary
We split out a new `lost-keyword-for-regular-parameter` rule for a
special case of `incompatible-method-override` where the overriding
method drops a keyword parameter (renames it, or makes it
positional-only). This is how the new diagnostic looks like:
```python
class Base:
def scale(self, factor: int) -> int:
return factor * 2
class Wrong(Base):
def scale(self, multiplier: int) -> int:
return multiplier * 3
```
```text
error[lost-keyword-for-regular-parameter]: Override of method `scale` disallows keyword arguments allowed by the method on the base class
--> example.py:7:9
|
7 | def scale(self, multiplier: int) -> int:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Base.scale`
|
::: example.py:2:9
|
2 | def scale(self, factor: int) -> int:
| ------------------------------- `Base.scale` defined here
info: the parameter named `multiplier` does not match `factor` (and can be used as a keyword parameter)
info: This violates the Liskov Substitution Principle
Found 1 diagnostic
```
## Test strategy
New Markdown tests
<details>
<summary>Ecosystem impact</summary>
Across 165 projects, 1,946 existing errors moved from
`incompatible-method-override` to the new rule at the same locations and
severity. The linked run used the previous name,
`missing-keyword-in-override`.
The split surfaced 65 previously suppressed errors. Sphinx (28), Kornia
(25), and Altair (2) disable the old rule in configuration. The other 10
errors appeared at inline suppressions in pip, Streamlit, scipy-stubs,
and pandas-stubs. Seven of those comments also triggered
`unused-ignore-comment`.
The run reported no timeouts or abnormal exits and an average timing
factor of 1.00×.
</details>
---------
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Rename the method, attribute, property, and mutable override rules to
`incompatible-…-override`. The old names remain aliases in configuration
and inline suppressions:
| Before | After |
|---|---|
| `invalid-method-override` | `incompatible-method-override` |
| `invalid-attribute-override` | `incompatible-attribute-override` |
| `invalid-property-type-override` | `incompatible-property-override` |
| `invalid-mutable-override` | `incompatible-mutable-override` |
A follow-up PR will split `invalid-method-override` into two rules.
Fixesastral-sh/ty#2001.
---------
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>