ruff/crates/ty_python_semantic
InSync 46be305ad2
[ty] Include synthesized arguments in displayed counts for `too-many-positional-arguments` (#18098)
## Summary

Resolves [#290](https://github.com/astral-sh/ty/issues/290).

All arguments, synthesized or not, are now accounted for in
`too-many-positional-arguments`'s error message.

For example, consider this example:

```python
class C:
	def foo(self): ...

C().foo(1)  # !!!
```

Previously, ty would say:

> Too many positional arguments to bound method foo: expected 0, got 1

After this change, it will say:

> Too many positional arguments to bound method foo: expected 1, got 2

This is what Python itself does too:

```text
Traceback (most recent call last):
  File "<python-input-0>", line 3, in <module>
    C().foo()
    ~~~~~~~^^
TypeError: C.foo() takes 0 positional arguments but 1 was given
```

## Test Plan

Markdown tests.
2025-05-14 22:51:23 -04:00
..
resources [ty] Include synthesized arguments in displayed counts for `too-many-positional-arguments` (#18098) 2025-05-14 22:51:23 -04:00
src [ty] Include synthesized arguments in displayed counts for `too-many-positional-arguments` (#18098) 2025-05-14 22:51:23 -04:00
tests Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
Cargo.toml Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
build.rs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest.py Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest.py.lock Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00